[HELP!] Fluid animations?
Hello, I am wondering if anyone knows how to make teleporting the player a bit smoother. In my Flip mod the player teleports I want it to be more fluid. Any help would be nice
I am using Vector3's to teleport the player to relative vectors, for example: Game.Player.Character.Position = Game.Player.Character.UpVector * 0.75f; I want to make that smoother!
@NotCrunchyTaco I use this for my Rocket League mod.
var currentheight = 16f; //define the maximum height do you wish to limit
if (playercar.Position.Z < currentheight)
playercar.Velocity += playercar.UpVector * 1.4f + playercar.ForwardVector * 0.8f;
Function.Call(Hash.SET_VEHICLE_GRAVITY, 1f, false);
//and do you wish to set gravity on again, use this.
Function.Call(Hash.SET_VEHICLE_GRAVITY, 0.0f, true);
P.S. Since, my entity is Vehicle, thus I used function car, but check with yours, I just gave you the idea for smoother transition. Good luck.
@ashishcw Thanks! I will try it. Hopefully it works!
@ashishcw Sadly it didn't work the ped just played the jumping animation on the ground
Ped player = Game.Player.Character;
Vector3 fDir = player.ForwardVector;
Vector3 uDir = player.UpVector;
Vector3 vel = player.Velocity;
float forwardForce = 2f;
float upwardForce = 4f;
Vector3 newVelocity = new Vector3(vel.X + (fDir.X * forwardForce), vel.Y + (fDir.Y * forwardForce), vel.Z + (uDir.Z * upwardForce));
player.Velocity = newVelocity;
Adjust upwardForce and forwardForce to your liking.
This will apply velocity to your current velocity in a forward and upward direction. If you want to set an exact velocity, you can edit newVelocity to this:
Vector3 newVelocity = new Vector3(fDir.X * forwardForce, fDir.Y * forwardForce, uDir.Z * upwardForce);
I'm on mobile so sorry if there are any mistakes!
@NotCrunchyTaco Well then, try the solution provided by @stillhere, that looks more legit and easy to use. One thing to note about the vectors in this game, try and be specific with all the vectors you are trying to edit/access.
In above example which stillhere provided, he had specified each aspect along with the current velocity of the character, which gives more precise reading and execution methods to the script & game.