1
\$\begingroup\$

I have a script trying to get the gun aim at the target instead of the origin:

enter image description here

It's partially working.

enter image description here

but when I get too close with the mouse the player starts spinning

I would appreciate a help regarding why it happens and how to fix it.

\$\endgroup\$
1
  • \$\begingroup\$ I have reuploaded the images to stack's imgur service, available from one of the tools in the question text toolbox. Please use this service as other services do not guarantee that the image will remain available for life. And if the images become unavailable, your question becomes much unclear. \$\endgroup\$
    – Vaillancourt
    Dec 11, 2016 at 1:51

1 Answer 1

1
\$\begingroup\$

You're using image_angle (the current rotation) to calculate the new rotation for your character, this is what's making it spin - it just keeps summing every frame.

If your goal is to make the character's weapon point at the mouse, take a look at the answers here.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .