hi. i wanna make an effect for my game. when the bullet hits a corpse it would move it
i’ve tried it before may times but fail. i need an example how games such as RON. or Crisis response that does this effect
What do you want to achieve? i want to make an effect that would move the body when hit by a bullet
What solutions have you tried so far? i’ve tried with velocities but i am unsuccessful because it wouldn’t move after laying on the ground
Example, WARNING it simulates gore
although its in 2D i’m just giving an example to make you understand on what i’m talking about.
if its a corpse, then its probably not moving with the velocity due to network ownership, so set that to nil and you’ll be fine.
If its a player, then (assuming you’re doing hit checks on server) you could fire a remote event to that player and then locally create a velocity to move the player back.
You should use a LinearVelocity which is relative to world so you can just set it to bullet.CFrame.LookVector * speed.
hey. uno again. can i ask you a question? i tried looking at tutorials and it’s very unclear how i can activate the LinearVelocity. If you could help me out that would be epic
Uh, you create a new LV and store it in a variable using Instance.new()
For best functioning I’d recommend setting MaxForce to math.huge.
After that set LV.RelativeTo to Enum.ActuatorRelativeTo.World
Then for actually setting the velocity you have a couple of options:
If you want the player hit to move backwards in the direction of the bullet, then you get the LookVector of the bullet and set the LV.VectorVelocity to LookVector * speed. Speed is how fast the push is.
Otherwise if you want them to go backwards relative to their own rotation you could set LV.VectorVelocity to hitPlayerCFrame.LookVector * -speed.
Both methods involve the LookVector, but its upto you whether you use the bullet’s or the player’s to get desired result.
ONE NOTE TO BE SURE: This has to be done on the client having network ownership of the body. If it is another player, this has to be done locally on their client to replicate properly. If its server then it should be done on the server.
oh thanks bro. i didn’t know. but i found a simple solution to my issue. i used BodyVelocity and making the maxForce to the max. and hten making the velocity to Head.CFrame.LookVector*speed
but incase if bodyVelocity gets so broken i might use linear velocity. i am aware the bodyVelocity has been deprecated. im still going to use it because it’s simple. thank you guys for helping