#Vehicles
16 messages · Page 1 of 1 (latest)
There are too many ways to do so. The most simple way would be have controller for car. When guy gets into car give authority of the car object to the player. And disable player 3D character. And when you get out of car just update the location of character at getting out of car location. I strongly suggest dont Update transform of character while in the car, to save some bandwith. And just start updating car Transform when you drive.
but there are too many methods to approach
Do you know of any good posts or videos that talk about it? I'm melting my brain messing around with trial and error
Could just parent player to Car holder transform, disable the NetworkTransform, disable your player input, and enable the car's input? then just a NetworkTransform on the vehilce, maybe a SyncVar to disable the triggers or whatever you use to mount it, so other players cant mount on top of you lol
then unparent, move to dismount position, reenable NetWorkTransform
If you wanna use animations, youll probably need a Statemachin Behavior to talk to your player controller script, to handle smooth mounting. Malber's HAP system does this well
that is pretty much what I'm trying to do... the main issue I'm really confused on is this: if one player drives the car for a bit and then gets out, and then the other one gets into it, he can drive around and the car's position updates correctly on both clients; but when he gets out the vehicle snaps back to where it started (where the first player left it). Any idea what's going on? I'm removing authority in my getOut() function
oh what else is weird is that it goes back only on the client that was driving, other connected clients see it left where it should be
and everything works fine so long as nobody swaps vehicles
I think I got this working but not sure if I’m doing it right. Basically I’m never giving auth back to the server, just giving it to the next client. Is that ok? Going to be a coop game so cheating shouldn’t be a big problem
@sick totem you mean giving it directly to the next client solved this issue?
@sick totem ok. You should be resetting your buffers everytime you change authority, to server or client.
Hey lol, so im struggling with a setup for this as well. my vehicles all work client side for each player, even host, BUT the Transforms are not updating anymore over the netwrok. My thinking was i could just stick a Network transform on a vehicle, and it would update normally for everyone, but that doesnt seem to be working anymore,