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\$
  • \$\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 '16 at 1:51
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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.