playMaker

Author Topic: Hit Reaction During Translate [SOLVED]  (Read 1656 times)

agito1987

  • Playmaker Newbie
  • *
  • Posts: 37
Hit Reaction During Translate [SOLVED]
« on: January 31, 2017, 08:35:15 AM »
Hey fellow Playmaker users.
I have a question regarding moving object.
Right now I am using translate to move object from left to right.

What I want:
When the object gets hit by a trigger give it a little push (visually showing you hit it.)
I have tried this by using I tween functions but they don’t work for me.
I tried to move the object on trigger enter a certain amount via move to position.
But then the object always loses its original path. (It will end up higher or lower.)
I could do this by simply switch the height position. But I want it to be a smooth movement, and also keeping the object moving from left to right. =\


Extra question:
Is it possible to translate an object along a strait path but give it some hover like movement? So it doesn’t look so stiff? Or do you need animations for that?

Thanks in Advance  =)
« Last Edit: January 31, 2017, 11:18:26 AM by agito1987 »

kavery

  • Full Member
  • ***
  • Posts: 149
Re: Hit Reaction During Translate
« Reply #1 on: January 31, 2017, 10:08:12 AM »
Itween Move To is a perfect action for this. Make sure you're aware of local vs world movements.  If it doesn't move in the direction you want, then you're using the wrong axis? One way to return to your starting position is to do a Get Position first - store as a vector 3 variable, then Move To this variable after the first Move To is done.

For a hover, you could make the object a child of a blank game object.. then give the blank object a Move To action with a ping pong loop type. It might need to be an independant FSM depending on how you setup states for the first object.

agito1987

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Hit Reaction During Translate
« Reply #2 on: January 31, 2017, 11:17:27 AM »
Thank you kavery !

I had tried I Tween when I was just starting with playmaker and my object always flew away when I tried the impact reaction, so I dropped it.
(It did so because it was set to world and not self.)

I feel really stupid now XD  I was completely overthinking my problem.
Well thanks for removing my brainfart, by pointing me to the solution ^^

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Hit Reaction During Translate [SOLVED]
« Reply #3 on: January 31, 2017, 12:08:23 PM »
Hi,
you should use dotween, itween is laggy and outdated.

you can find dotween actions here