[Help!] How to set a growth limit on static mesh?

So in the image i have a blueprint witch increases the static mesh growth over time, but the growth never stops and goes on forever. So my question is how would you set a growth limit so that once it reaches that certain scale it will stop growing. Much help appreciated!

There are probably a couple of ways of doing it. Probably the easiest is to use a clamp before set the variable.

Look up “Clamp(float)”. You will be able to set the max bounds it will go.

Have fun!

Thanks, but i’m a little new in blueprints where do you connect the Clamp node?

You’d have to clamp the entire scale vector: Place 3 Clamp (float) nodes between your EventTick and SetActorScale3D. Split the output value of the GetActorScale3D and the input of SetActorScale3D and instead of connecting each value (x,y,z) directly, loop it through one of the Clamp nodes first. If you want, you can set different min/max values for each of the x/y/z axes.

The best way to do this is probably with a Timeline:

Creating the Timeline

  1. Create a Timeline in your EventGraph (not possible in functions)
  2. Open the Timeline
  3. Set the Length to the time in seconds the scaling should take
  4. Add a float track (by clicking on the f+ button)
  5. Add two keys by rightclicking in the track
  6. For the first key, set the time to 0 and the Value to the initial scale (presumably 1)
  7. For the second key, set the time to Timeline Length and the Value to the target scale
  8. Close the Timeline, save and compile

Playing the Timeline

  1. Link your IncreaseScale event to the Play execution input of the Timeline
  2. Link your SetActorScale3D execution input to Update
  3. Pass your track variable into the SetActorScale3D value input
  4. Save and compile your Blueprint

Your timer on BeginPlay specifies the delay with which IncreaseScale will trigger, but it will only play once. If you want anything to happen after the scaling has finished, you can hook that behavior into the Timeline’s Finished execution output.

Alternatively, you could also use a Vector track (V+ button) and use separate keys for each of the axes, then feed the resulting vector parameter directly into the SetActor3D node. That’s probably cleaner (because the output already is a vector) but if you have no experience with Timelines it could be more confusing (because you edit 3 values in one track).