Transform.rotation

Hey. I’m just doing the section where we instantiate a bullet in TileVania, and we’re told to use transform.rotation for the rotation of the bullet as it spawns. But won’t that reference the rotation of the player, not the bullet? I used a 2d capsule to make my bullet, and to get it to face the right direction I needed to give it a rotation of 90 on the z-axis. Using the example code, the bullet spawned the wrong way. When I changed my code to read bullet.transform.rotation, though, it spawned correctly.

Hi tiarali,

I’m not sure if I understood your question correctly. From what I read, you did use transform.rotation to rotate the bullet: bullet.transform.rotation.

Privacy & Terms