Hi guys,
Nice and simple one here that’s totally got me stumped. All I want to do is rotate my player’s gun location relative to the player’s orientation. Here’s a video of the current state along with the code used at this point.
The large, outer square in the video is the player’s mouse cursor, which they rotate and look towards, the smaller inner square is the gun location - where bullets spawn from.
transform.position.x = player.transform.position.x + Mathf.Sin(player.transform.rotation.y);
transform.position.z = player.transform.position.z + Mathf.Cos(player.transform.rotation.y);
Any help is appreciated!!