Have the sprite's aim rotate to the mouse position
Cocos
NOVEMBER 8, 2023
I’m building demo for a top-down shooter and I want the sprite to aim and rotate where the mouse is pointing. I’m having trouble getting the sprite to rotate correctly. It only goes 180 and then back to 0, not going a full 360. mousePos.y - center.y); const angle = Vec2.angle(direction,
Let's personalize your content