playMaker

Author Topic: How to scale instantiated prefab by +1 x/y/z per trigger enter [SOLVED]  (Read 2219 times)

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
I instantiate a prefab at runtime.  It starts at a scale of:
X = 3
Y = 3
Z = 3

When the prefab hits a trigger, the prefab needs to increase in scale by 1.  So the new scale would be:
X = 4
Y = 4
Z = 4

...etc

Currently, I can only get it to SET my scale to 1 instead of actually INCREASING my scale by 1.  Please help!  Thank you!
« Last Edit: December 11, 2012, 11:28:22 AM by Shawn Kilian »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to scale instantiated prefab by +1 x/y/z per trigger enter
« Reply #1 on: December 11, 2012, 05:10:26 AM »
Hi,

 What you need to do is the following:

1: get the scale and store it in a vector3 FSM variable
2: use "Vector3Add" action to increment the values by 1
3: set the scale using the vector3 variable

 Bye,

 Jean
 

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: How to scale instantiated prefab by +1 x/y/z per trigger enter [SOLVED]
« Reply #2 on: December 11, 2012, 11:06:41 AM »
Thank you so much, that actually worked.  I appreciate all of your help.
« Last Edit: December 11, 2012, 11:28:05 AM by Shawn Kilian »