Is there a function that i can call to apply force

i wanna apply a velocity on a part straight and simple i got the direction i got the magnitude plain and simple. accuracy is essential for my game also is there a way to do this without instancing cuz unneccesary metatables,properties,connections,functions aka unneccessary memory leak i will be using forces everywhere in my game about 1-10 every 1-5 seconds

There is :ApplyImpulse
https://developer.roblox.com/en-us/api-reference/function/BasePart/ApplyImpulse

You can also change the parts AssemblyLinearVelocity
https://developer.roblox.com/en-us/api-reference/property/BasePart/AssemblyLinearVelocity

I’d suggest using VectorForce and an attachment. They make doing this stuff very easy and even come in with built in damping (which can be turned off), and the ability to apply at assembly’s center of mass. If you want to apply the force for only a frame, ApplyImpulse is much easier. It’s not suggested to change the assembly linear velocity directly as it can cause huge jumps in force and unrealistic physics behavior, as you’re basically hacking the physics simulation to change its results.

1 Like

Revision: Just realized you have a velocity you want to apply, not a force as the title suggests. In this case, you could just use BodyVelocity rather than assigning to the linear velocity, which is an improvement. However, body movers have their own problems and are deprecated, so I’d still suggest using force and maybe a custom smoother that gets the AssemblyLinearVelocity and adjusts force based on it. I did a similar thing for my wheels for a vehicle but with torque and angular velocity instead of vector force and linear velocity, respectively.

it requires network ownership

requires network ownership

that is exactly what i did i had to go through 2 physics textbook to prepare the formulas for my entire system but the thing is that i dont want it to go through a pid controller