playMaker

Author Topic: Rotating an object with the mouse  (Read 2828 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Rotating an object with the mouse
« on: June 25, 2013, 04:26:33 AM »
Hi!

Eventually Id like to do this with a finger on a iPad, (how do you test that actually? Do you have to build and upload to iPad everytime?)

Anyway.. I need to be able to drag on the object and rotate it. If you drag left it rotates left and vice versa.

This setup, (see pic ) doesn't work, obviously very simplified approach, but how should I achieve this.
I would like it to also be ONLY if you actually click the object itself, but this example was supposed to be just anywhere in the screen...

If its not obvious.. I was "trying" to get the mouseX, store it, and then add it to a new position of the mouse, as long as mouse is held down. If released, reset var to 0 (was expecting to go minus if you move left, but as all floats I get are 0.somthing.. its doesnt work as expected..

What next?

Cheers

MArk




jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rotating an object with the mouse
« Reply #1 on: June 27, 2013, 01:42:04 AM »
Hi,

 testing touch inputs from Unity editor is possible. You need to install Unity remote app on your iphone or ipad and when you run your scene in editor you can use your touch screen. It's not as accurate of course, so do very calm gestures, else touch events are skipped. I use it all the time, it's essential to not waiste time.

Here is a test scene that drags using mouse. I'll let you implement variations using touch, if you have trouble let me know.

bye,

 Jean

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Rotating an object with the mouse
« Reply #2 on: June 28, 2013, 06:52:19 PM »
Thanks for that Jean... GREAT!

queture

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Rotating an object with the mouse
« Reply #3 on: July 26, 2015, 04:28:52 PM »
Hi, I'm also looking for some help on this as well. Any advise if i can rotate in all XYZ axis? thanks.
« Last Edit: July 26, 2015, 04:37:47 PM by queture »

rizwanash

  • Junior Playmaker
  • **
  • Posts: 61
Re: Rotating an object with the mouse
« Reply #4 on: July 10, 2019, 05:58:08 PM »
Hey Jean,
Sorry to bring this topic up again, I wanted to know can we clamp the values of rotation so it dont rotate 360 ?

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Rotating an object with the mouse
« Reply #5 on: July 12, 2019, 03:06:33 AM »
Hi,

 Can you look at this thread: https://hutonggames.com/playmakerforum/index.php?topic=8032.0

 maybe this is what you need.

 Let me know.

 bye,

 Jean