I am trying to create an part to target me with RocketPropulsion, I wasted 2 hours trying to get it work, and it doesnt work. My Part is gone after I do :Fire() to RocketPropulsion. This is my localscript:
It’s bad practice to set the properties of just about anything other than the Humanoid when you’re using a LocalScript, so you should be running this from a script instead.Maybe you should try increasing the ThrustD value, as it seems like your projectile may be overshooting and deleting itself by going too far.
After messing around with it for a while, I think it might be an issue in which the projectile falls asleep and stops short of its target. Since the projectile exists on the server, any physical interactions on the client should replicate, which leads me to believe that this is some sort of simulation error. Constraints have essentially superseded body movers, so I don’t foresee this behavior changing anytime soon.
That being said, I was able to achieve the intended results on both the client and server by giving them complete control over the process. Assuming that you want the projectile to be visible on all clients, you would have to tell the server to create the projectile and set the target accordingly.
On a side note, I believe the flinging you were experiencing can be stabilized by increasing the density of the projectile or reducing the thrust.
Could you show me how you were able to get the projectile to stop short of its target and fall asleep? This might occur if the RocketPropulsion has the projectile moving at very low velocities, is that what happened?
If the projectile part is flying off into space, the issue is very likely due to it being too light for the RocketPropulsion’s parameters. I can’t see what the size or density of your projectile is, but increasing either one of those should solve the problem (Size: 1x1x1 and Density: 1 should work fine).
Upon further inspection, it looks like the projectile prioritizes the TargetOffset over the position of the Target object. After reaching the TargetOffset, the projectile falls asleep until it comes within a player’s SimulationRadius. Correct me if I’m misconstruing the documentation, but it is my understanding that the TargetOffset only takes the place of the target position when the Target is nil.
I think what’s actually happening is that the RocketPropulsion has no Target due to the property being set on the Client, so it just goes to the world origin + TargetOffset. It does correctly stop when reaching its goal. Once it enters your streaming radius, its able to actually set its Target as defined in the LocalScript, and move there. So no sleep issues here!
As @liuthemoo mentioned, the best practice here is to set the property on the server, not the client, as it won’t necessarily replicate to the server.