Hi everyone.
So I have a player and a target. I want the player to instantiate a projectile, with its rotation pointing at the target (from the player).
my idea was this-
shotDirection = Quaternion.FromToRotation(transform.position, target.transform.position);
if (Input.GetKeyDown(KeyCode.Keypad1))
{
Instantiate(projectile,transform.position,shotDirection);
}
but it seems that “FromToRotation” doesn’t work the way I expected it to.
Can someone please advice?