Move object forward in relation to the player

If I Drag a object with the standard DragRigidbody.js I want to move it to left, right, forward and backwards.

Its simple if I just Do it with a Vector3.forward left right or whatever, but its always in the same direction then, doesnt matter where my character is looking at.
So I want to do a “forward” in the direction where the player is looking. How do I do that?

Given a particular GameObject, you can use the properties of its Transform.

Let’s assume you have a reference to some GameObject. Let’s name the reference player.

If you need to find the player, you could do something like this:

var player = GameObject.Find("ThePlayer");

From there, you can get a few unit vectors:

player.transform.forward
player.transform.right
player.transform.up
(You could multiply these values by -1 to get their opposites)

The above values are basically similar to Vector3.forward, right, and up, with the exception that they’re relative to the player’s current rotation.