Topic: Changing the position of the character

i want to move my character at specific position like 0,0,0 when i ll play a special move. grinding but can't find any suitable solution to move my character. if i am trying to move my character through custom script then other player scripts are overriding its execution. any suggestion?

Share

Thumbs up Thumbs down

Re: Changing the position of the character

Use the OnMove event (or similar events) to change the position at runtime:

using FPLibrary;
using UFE3D;

public class TeleportCharacter : MonoBehaviour
{
    void Start()
    {
        UFE.OnMove += this.OnMove;
    }

    void OnMove(MoveInfo move, ControlsScript player)
    {
        player.worldTransform.position = FPVector.zero;
        player.transform.position = player.worldTransform.position.ToVector();
    }
}

For more on coding checkout http://www.ufe3d.com/doku.php/code

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.