I’m trying to instantiate an object in front of the player. For some reason, it instantiates along the x and y values correctly, but it doesn’t take into account the player’s rotation, causing it to end up along the global z rather than the local with this:
theObject : GameObject;
function Update() {
if (Input.GetKeyDown(KeyCode.E))
Instantiate(theObject, Vector3(transform.position.x, transform.position.y, transform.localPosition.z + 1), transform.rotation);
}