Attaching camera whilst in spec mode.
#1

Okay, so the title is pretty short, but the question is not.

Basically, I want to attach the player's camera inside a vehicle, but I do not want to create any timers which can then produce lag. I've tried making individual 'bots', which would then drive you around rather than having the player spectating, but the FCNPC plugin is somewhat not working with vehicle recordings (it removes the bot from the vehicle, sets a random virtual world for the vehicle and once it's finished recording it would then return the bot to the vehicle).

My first approach was to set the player as spectating, but using AttachCameraToObject(...), would just return to the coordinates: 0,0,0. Yes, the object I used was being attached successfully to the vehicle. To check, I spawned the player and placed it under OnPlayerStateChange for when the player had new states: foot -> passenger. It works fine, when the player is spawned but not spectating. Which is a massive problem! Why? Once the player is out of streaming distance, objects lose their texture, or things simply don't stream. As mentioned, I'd prefer not to have a set timer setting the player's position or what not.

Any idea? Giving rep for a working answer.
Reply
#2

Would it be possible to see what you have so far?
Reply
#3

I've actually came to a conclusion with using a different NPC plugin, which should allow me to create a bot, for whoever does x task. But the attached camera issue, should be addressed.

Guess this is solved, thanks anyway!

@Above poster: it was pretty much creating the object, then attaching it to the vehicle and then attaching the camera. It only works if the player has successfully spawned. Unless I'm wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)