playMaker

Author Topic: [SOLVED] how to iTween move along a single axis only?  (Read 3523 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
[SOLVED] how to iTween move along a single axis only?
« on: June 19, 2013, 11:03:14 AM »
How do I use iTween to move along with a single axis only? I only want to move it along Y axis only so it could move freely on other axis.
« Last Edit: June 20, 2013, 02:51:07 AM by ryf9059 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to iTween move along a single axis only?
« Reply #1 on: June 19, 2013, 01:41:25 PM »
Hi,

 use a dummy gameobject for this.

 have an "empty" game object and you attach to it your actual object.

 you animate with itween the dummy, and the object de facto follows the dummy because it's a child, yet it remains free to do its own movement.

does that make sense?

bye,

 Jean

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: how to iTween move along a single axis only?
« Reply #2 on: June 19, 2013, 02:00:51 PM »
use a dummy gameobject for this.

 have an "empty" game object and you attach to it your actual object.

 you animate with itween the dummy, and the object de facto follows the dummy because it's a child, yet it remains free to do its own movement.

does that make sense?

I got what you mean but I'm not sure if that suits my senario.

Actually I'm moving a camera target, that says, it will be followed by the camera.

I already have the horizontal flip implemented, but now I want it also move along certain path vertically while jumping. So when I jump and turn around in the air at the same time, the camera target is going to both flip horizontally and move vertically.

If I use a child it will be 2 objects (the camera targe and the dummy) and that will confuse the camera, which to follow? So I thought I might need a single entity to achieve this.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to iTween move along a single axis only?
« Reply #3 on: June 20, 2013, 01:26:35 AM »
Hi,

 That's fine, you will still target your gameObject, you will not target your dummy at, the dummy is only here to "rig" your system. Visually it will look exactly as if there was only one object.

it's true that if you had a video or a demo of what you would like to achieve, it would be easier to provide an alternative, maybe you don't need iTween to begin with.

 one more thing, you could use "animate float" action, and then inject that value into your transform position only on one axis.

bye,

 Jean