- Home /
Question by
edexman11 · Jan 05, 2021 at 10:02 PM ·
rotationscripting problem
projectile spawns above the player and not in front of it
this is what my code looks like atm, and i wanna change truerotation to the gameobjects rotation, but changed by(90,0,0): `
public GameObject Capsule;
public Quaternion truerotation;
// Start is called before the first frame update
void Start()
{
Capsule = GameObject.Find("Capsule");
}
// Update is called once per frame
void Update()
{//weird engine bullshit
truerotation = this.gameObject.transform.rotation;
//attacks
if (Input.GetKey("mouse 0"))
{
Capsule = Instantiate(Capsule ,this.gameObject.transform.position, truerotation) as GameObject;
}
}
Comment
Best Answer
Answer by MSavioti · Jan 05, 2021 at 11:44 PM
Try this:
trueRotation = Quaternion.Euler(90, 0, 0);
Your answer