How do i make a ped to a position?
-
I was trying to make it so that my ped start walking to a certain area but it does not do anything
Here is my code
Function.Call(Hash.TASK_GO_STRAIGHT_TO_COORD, -1, MYPED, 5310.6299f, -5307.352f, 82f, 1f, 1000, 83f, 1f);
-
@M8T Game.Player.Character.Task.GoTo
public void FollowToOffsetFromEntity(Entity target, Vector3 offset, float movementSpeed, int timeout = -1, float distanceToFollow = 10, bool persistFollowing = true);
public void GoStraightTo(Vector3 position, int timeout = -1, float targetHeading = 0, float distanceToSlide = 0);
public void GoTo(Vector3 position, int timeout = -1);
public void GoTo(Entity target, Vector3 offset = default, int timeout = -1);I used this code in a script of mine
Game.Player.Character.Task.GoTo(PedTemp, new Vector3(0, 0, 0), 19000);
-
@JohnFromGWN Game.Player.Character.Task.GoTo(Game.Player.Character, new Vector3(5310.6299f, -5307.352f, 82), 19000);
This just freezes my character
-
@M8T Look at your code. Where are you asking the player to go? Player to Player.
Put another Ped (PedTemp in my example) where you want to go. In other words spawn Ped Temp at new Vector3(5310.6299f, -5307.352f, 82).
If you don't want the Ped to be visible, make it invisible.Once the Ped is spawned, then you can do Game.Player.Character.Task.GoTo(PedTemp, new Vector3(0, 0, 0), 19000);
That's why the new vector is set to zero, no offset required or desired.