Help with replicating from Client to the Server

Problem

So i am changing the velocity of a “BodyVelocity” inside the HumanoidRootPart on client. The velocity changes every renderstep depending on the clients camera CFrame, the reason am doing it on client is cause i cant manipulate a clients camera on server, so how would i replicate the Velocity to the server?

Script

				local look = Camera.CFrame.LookVector
				local flat = Vector3.new(look.X, 0, look.Z).Unit
				
				
				BV.Velocity = flat * 30
				BG.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Char.HumanoidRootPart.Position + flat) 

BG stand for BodyGyro

What am trying to do

Am trying to make a mount (Crocodile) that the player rides on. The mount cannot be stopped and will always move towards the camera CFrame.

What i’ve tried

Am welding and creating the BodyVelocity/BodyGyro on server. I have also tried setting the mounts NetworkOwnership to the player/server. From the Servers point of view the player is just standing still on the mount. Any help would be Appriciated thanks.

1 Like

Well make sure you are setting the network ownership on the server.

If it’s owned by that client, it can make changes to the BV and replicate to the server. However if it isn’t owned by the client it won’t be replicated.

If this doesn’t work you could just send a vector3 value for the expected velocity to the server as a last ditch attempt, however I wouldn’t recommend that at all.

You could just pass the camera information to the server.

You need to keep in mind that client side scripts only effect the one player.

So you need to pass on the player or character to the server. (I prefer using player as you will most likely end up needing player at some point anyway)

You can use Player.Character to get the character then from there add in the Velocity.

I would look into Creating a remote event. so rather than moving it on the local script, fire the server to make the server create the velocity. It will have the same desired effect but it will be on server side.

BV.Velocity = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.lookVector * 70 – thats the speed

Hey so i’ve tried setting the mounts networkownership to both the server and client but the Velocity still doens’t replicate to the server. So the code is actully inside a renderstep event, because i want the mount to keep moving all the time. Because of that i wanted to avoid using a remote event because then ill have to send the Cameras LookVector to the server every renderstep.

Does it work on the Client?
Are you sure you are setting networkownership to ALL of the baseparts in the model?