Hello, I am making a simple rpg and on the overworld you can cast spells. I am currently working on a fireball, but when it appears, it claims to be pointing in the direction i want in the editor, but it always goes downwards. Here is my script.
if (Overworldfireshot == true)
{
fireball.SetActive(true);
rb2d.velocity = transform.forward * speed;
}
if (Input.GetKey("w"))
{
fireball.transform.LookAt(t1.transform);
}
if (Input.GetKey("a"))
{
fireball.transform.LookAt(t2.transform);
}
if (Input.GetKey("s"))
{
fireball.transform.LookAt(t3.transform);
}
if (Input.GetKey("d"))
{
fireball.transform.LookAt(t4.transform);
}
t1, t2, t3, t4 are all one unit away from the player and the fireballs starting location in the four directions. If a question like this already has been answered, please link me to as I cannot find one. Thanks!