How Can I scale the spawn actor

Hi Ppl!
I have this question of how I can scale the spawn actor.
The example is like this:
I have a ball, when its dead spawn an explosion actor, but... In some scenes the ball is bigger and the spawn explosion keeps its original size.
How can I modify that?
Thnx in advance!!!

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Create 2 real game attributes and call them something like SphereSizeWidth and SphereSizeHeight.

    Before your ball dies, change the SphereSize attributes to the width and height of your actor. When the explosion spawns, change it's size (width and height) to the SphereSize attributes.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    In your ball actor, right before you spawn the explosion Change Attribute game.ballWidth (real) to self.Size.Width [if it's round you don't need to worry about the height]. In your explosion actor, Change Attribute self.Size.Width to game.ballWidth and Change Attribute self.Size.Height to game.ballWidth. Those behaviors should be at the top of the explosion actor's rule list but not inside of a rule. If you need to add or multiply the ball width by a value, you can also do that.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @tatiang said:
    In your ball actor, right before you spawn the explosion Change Attribute game.ballWidth (real) to self.Size.Width [if it's round you don't need to worry about the height].

    You could also pass that value on through the spawn's 'Direction' field without any need for attributes.

  • PotatoesAppsPotatoesApps Member Posts: 53

    Thnx!!! You ppl are the best!

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Socks I always forget about your suggestion to use built-in non-essential attributes. Good idea! So you would set the Direction value and then in the spawned actor, you would change its width to self.Rotation and then change self.Rotation to 0 (or whatever value you prefer).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:
    You could also pass that value on through the spawn's 'Direction' field without any need for attributes.

    Dang you and your big brain!

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @tatiang said:
    Socks I always forget about your suggestion to use built-in non-essential attributes. Good idea! So you would set the Direction value and then in the spawned actor, you would change its width to self.Rotation and then change self.Rotation to 0 (or whatever value you prefer).

    Yeah, basically that, in the spawner Direction is set to self.width - in the spawned actor we have width and height to self.Rotation - then set the rotation to 0.

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @Braydon_SFX said:
    Dang you and your big brain!

    :tongue:

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:


Sign In or Register to comment.