This line of code works in studio but not online?

It’s meant to throw a brick forward in relation to its rotation, everything works but the velocity. The player just drops it instead.

Does the player have physics ownership?

1 Like

No they don’t

Set the network owner from serverside so the client has velocity control. Also make sure to set it back to auto when you’re finished with what the client needs to do.

1 Like

Still the same problem

it seems like the velocity being applied isn’t even there online? Yet in studio it works fine…

I was trying to make a slap command a while ago to send players flying around at slaptastic speeds and ran into a similar issue.

1 Like

You should try using a bodymover (like a BodyVelocity) instead of directly setting the velocity - the game engine tends not to like changing physics properties like this at run time

1 Like

You need to debug your code to see where the code does what is unintended.

Print before setting velocity to make sure that the line is being ran when you expect it to.
Print the various components that make up the line to make sure that they do as expected.
Print the result before setting the velocity to it.
If everything is good until here, then there is some kind of other problem like the physics engine not knowing that the part is awake or that the change is not being replicated properly.

1 Like