MineTurte
loading
Yeah I knew that turning always right would be a problem. I would've made it correct if I had more time lol. This is a better solution as it will always turn towards the player (as opposed to turning clockwise until it's in the right direction). Put a call to this custom block in the update script of your enemy so that it runs every framedefine Turn towards player
set [current direction v] to (direction)
point towards [player v]
set [target direction v] to (direction)
set [delta direction v] to (((((target direction) - (current direction)) + (180)) mod (360)) - (180))
if <([abs v] of (delta direction)) < (rotation speed)> then // rotation speed is the speed at which you want to turn towards the mouse pointer
point in direction (target direction)
else
point in direction ((current direction) + (((delta direction) / ([abs v] of (delta direction))) * (rotation speed)))
end