Rotation to face an actor
TraXsiv2
Member Posts: 29
Hello, In my game I have these stationary turrets that I want rotate to face the player actor at all times. I'm having trouble figuring this out. Thanks
Comments
Then, on your turrets, put in the behaviour rotate to
and in the X and Y fields, hit the little 'e' button next to it and make the X field 'playerX' and the Y field 'playerY'.
Hope that makes sense,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Thanks for you help
So far I have two GAME attributes which are playerX and playerY. they are set to 0 and both are integers
In my player's actor I have two "Constrain Attributes" self.Postion.X To PlayerX and self.Position.Y To PlayerY
As far as what goes into the turrets I am confused how to set everything up.
game.playerX to: self.position.x
game.playerY to: self.position.y
Offset angle: 0
Do the switch as FMG said.
Your method is cpu intensive and won't work for large projects with lots of turrets. Timers eat cpu.
Trust us, you don't need a timer. You need to use constraints.