playMaker

Author Topic: rotate a 2d sprite based on the mouse x screen.x position issue [Solved]  (Read 232 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
My screen is set up 1080 x 1920.

Planned mobile android development.

currently, I am using get mouse X, normalized every frame. stored as X

Screen to world point uses this X within the screen x and store in "world X", every frame.

Set property local rotation.z to the "world X". every frame.

However, after a few seconds, and moving the mouse, my sprite no longer rotates despite the variable clearly showing that the input is changing. The whole system stops after a few seconds always at -180 for the sprite.

It's like the sprite has got locked out of its movement and can not do anymore.

Could you possibly help me fix this issue?



 


 

« Last Edit: June 29, 2021, 07:09:41 PM by colpolstudios »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: rotate a 2d sprite based on the mouse x screen.x position issue
« Reply #1 on: June 29, 2021, 07:34:06 AM »
Hi.
Maybe make a short video to show your setup.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

colpolstudios

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: rotate a 2d sprite based on the mouse x screen.x position issue
« Reply #2 on: June 29, 2021, 05:46:42 PM »
I have changed my setup. with the initial issue resolved thank you for your reply.


« Last Edit: June 29, 2021, 07:09:10 PM by colpolstudios »