How to implement transform.LookAt?

chainsawpenguin

New member
Good afternoon, team! I hope you're all having fun as we head into the New Year!

I'm trying to implement a special script that stands outside of the normal UCC script. In that script, when a certain action occurs, I want the player to turn and look at a specific point. I've coded this as transform.LookAt(myTarget.transform), and I can confirm that I'm reaching that point in my script, and that myTarget is correctly defined, with Debug statements.

However, the player does not actually turn to face the target, presumably because something in the UCC is overriding his rotation.

Does anyone have any ideas? I tried disabling UCC at that point, but the player disappears from the scene entirely if I do that (for some reason). I would like to know how or where to override the player's rotation for a single frame (and then give control back to the controller).

Thanks in advance for any guidance/suggestions/recommendations!!

JW
 
Happy New Year!

For this you'll need to create a new ability - this will allow you to define how your character is rotated so the Deterministic Object Manager won't override the change.
 
Aha! Very cool, thanks!

Sometimes the Ability system is a heavier lift than I need, but it's EXTREMELY well thought out. In this case, I actually only needed to allow rotation for a single frame, and I doped out how to do that with the information above.

As always, thanks for the quick and extremely helpful response!!
 
Top