Trying to replicate projectile movement

  1. What do you want to achieve?
    I want to replicate the following:
    balerattack
    Specifically the Superball’s movement.

  2. What solutions have you tried so far?
    I have tried using BodyVelocity, but they seem to be jank. I edited the velocity, maxforce and P parameters to fit accordingly but it still doesn’t seem to be accurate. (Maybe running a velocity on the client could work?)

Another solution I tried was getting the Unit of the vector between both target and model’s position.

Could this be replicated with any other movement force method, or have I not researched enough?

Try using AlignPosition to achieve this effect, i used it for a pretty similar scenario.

It’s not clear what specifically you are requesting help with. You can get something to act like a thrown ball by setting it’s Velocity to the direction you want it to go multiplied by how fast you want it to move. You can also make it bounce by adjusting the elasticity to be higher.

In my game I have a projectile system where the ‘ball’ ( in my case, fireball ) is strictly a client-owned object. When the player fires, a request is made to the server, and if everything is good ( I’ve got ammo, the right weapon, etc ) the server fires back to all clients an instruction to create a local fireball and send it on its way. From the point of view of the server, there are no objects flying around or physics calculations. The trade off here is that each game client is responsible for ‘animating’ the projectile and bouncing it around as the client sees fit and you end up with a more solid representation. In truth each client may witness something slightly different, but 99.99% of they’ll never know unless they have two computers side by side. You’ll just need to make sure that only the client that fired the projectile can request damage or create score, and then dummy check that server-side. If I understand your problem is just glitchiness, maybe this will help.

1 Like

This works perfectly, needs some polishing around the edges but I think I can make it work with AlignPosition, thank you very much.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.