How Can I scale the spawn actor
PotatoesApps
Member Posts: 53
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
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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
You could also pass that value on through the spawn's 'Direction' field without any need for attributes.
Thnx!!! You ppl are the best!
@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
Dang you and your big brain!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx