#oh sorry that should be
1 messages · Page 1 of 1 (latest)
transform.rotation.y is not a meaningful value. It is the second component of a Quaternion.
you can get the Euler angles from the rotation, although manipulating Euler angles can still be error-prone
@cold otter It would help if you described what you want to achieve with this one-axis rotation functionality
well i want to achieve my enemy game object not rotating up toward the player and doing a fnaf 2 jumpscare
with transform.lookat it also just turns the whole enemy toward the player at all times and it looks weird asf
var lookPos = player.transform.position;
// Align the lookPos vertically to our own position so we dont look up and down
lookPos.y = transform.position.y;
transform.LookAt(lookPos);```
That should be all you need
ok
yep, that sounds reasonable.
ok so i forgot to lock the x and z rotation of the rigidbody and its really funny
if i knock over the enemy it just ceases to do anything
it just gives up completely
Sounds like a feature