playMaker

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

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
    • View Profile
Rotating an object with the mouse
« on: June 25, 2013, 01: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: 14014
  • Official Playmaker Support
    • View Profile
Re: Rotating an object with the mouse
« Reply #1 on: June 26, 2013, 10:42:04 PM »
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
    • View Profile
Re: Rotating an object with the mouse
« Reply #2 on: June 28, 2013, 03:52:19 PM »
Thanks for that Jean... GREAT!

queture

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Rotating an object with the mouse
« Reply #3 on: July 26, 2015, 01: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, 01:37:47 PM by queture »