ShakePosition and SetRelative in the visual editor
« on: July 16, 2015, 12:14:07 AM »
I am using ShakePosition via the visual editor. Is there a way to make the movement relative?

I know I can use SetRelative() if I do it all through code, but I want to start taking advantage of the visual editor since it is faster to tweak the values.

Thanks

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: ShakePosition and SetRelative in the visual editor
« Reply #1 on: August 04, 2015, 05:49:49 PM »
Hi, and sorry for the late reply (notifications stopped working for some reason),


Shake is already relative. Those X/Y/Z amounts represent the strength of the shake :)

Re: ShakePosition and SetRelative in the visual editor
« Reply #2 on: August 04, 2015, 06:57:08 PM »
Then how come if I enter .1,1 the object is moved back to the world position of the first time the shake tween was executed?

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: ShakePosition and SetRelative in the visual editor
« Reply #3 on: August 04, 2015, 09:37:44 PM »
Once a tween is created, it's fixed. The "relative" side of it is taken into account only the first time. Tell me more of what you're trying to do, and I might find a way.

Re: ShakePosition and SetRelative in the visual editor
« Reply #4 on: August 04, 2015, 09:40:19 PM »
I am trying to make an object shake every time the user clicks the mouse. It's an fps time game and the object is the cross hairs. I want then to shake.

I can do it programmatically but have issues using the visual editor. I am probably not rsetting the tween or killing it or something like that.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: ShakePosition and SetRelative in the visual editor
« Reply #5 on: August 05, 2015, 02:03:53 PM »
Mhmm I see. The problem is that shake/punch animations become fixed after startup (because they store an array of Vector3 points, in order to make them shake but with some "harmony"). It's working via API for you because I suppose you're recreating the tween instead of restarting the same one.


For your use case, I would actually recommend to use the code and recreate the tween each time.