How to push object in direction a player is facing C#?

What I want to achieve is I want the player to move up to a box and be able to double tap the box and once the player double taps or clicks the box then it will be pushed in that direction so many units. I am still pretty new to C# coding but not totally new. I honestly do not know where to start with this one. Maybe I am overthinking it lol. Any help would be appreciated :slight_smile: even if its just a point in the right direction.

Thanks in advance! :smiley:

If you want it to immediately move toward the position, you could always just set the position. Transform.position is settable.

If you want it to animate towards its destination, consider using Coroutines.
Unity has a tutorial on it here: https://unity3d.com/learn/tutorials/modules/intermediate/scripting/coroutines?playlist=17117

If you really want to move objects via force, you’ll have to do some fairly thorough kinematics math, accounting for all the other forces that may act on your object like gravity, friction and drag.