Hey there, I had a quick question : how can I keep a user in the air while doing punches ? So lets say both player and enemy are at a same position in the air and the player decides to punch the enemy, they would be able to do 5 punches in the air. how can I do that?
I would apply a vector force with a force equal to workspace.gravity * Character.PrimaryPart.AssemblyMass. This will counteract the force of gravity and keep them in the air, apply this vector force to both the person attacking and the person being attacked. Then, after every hit, delay a function to check if the attacker has attacked within a certain timeframe, if they haven’t then destroy the vector forces.
Using a vector force against gravity will turn you into an astronaut, floating in space punching air.
Use a BodyPosition
object, set the position to be (player position)Vector3
+ (Vector3.yAxis
* (studs in air)). Feel free to touch the other properties to your use-case.
1 Like