Same actor respawned in scene but different attributes

Hi all, i dont quite know how to explain my problem, but let me try.

I have an actor (ball) that is spawned and drops to the ground. When it drops to the ground, the attribute of the ball changes. When i touch the screen, the same actor has to be respawned. When it hits the ground, the attribute changes but it also changes the attribute of the initial ball.

Basically, ball A spawns and hits the ground and size increases when it hits the ground. Ball B (same actor) spawns and when it hits the ground its size increases but Ball A's size also increases again.

How do i go about making only the instance of the actor change its attribute on collision with the ground? There is no instance tab because the ball is not initally on the scene but is spawned on an action.

Thanks

Comments

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

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

  • breubanbreuban Member Posts: 13
    Hi Tatiang, thanks for takin the time to create that project. However, thats not what my problem is. In other words, how can i only control the respawned actor and have it not affect the previous spawn of the same actor?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Hi Tatiang, thanks for takin the time to create that project. However, thats not what my problem is. In other words, how can i only control the respawned actor and have it not affect the previous spawn of the same actor?
    I'm having trouble understanding that, sorry.

    In my demo, when a ball drops, it enlarges upon collision with the ground. Let's call those balls "new spawns." Any balls that fall after that will enlarge and also cause any "grounded" balls to enlarge. When we spawn a ball, it's always a new spawn. Are you saying you want "grounded" balls to NOT increase in size when other balls collide with the ground?

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

  • breubanbreuban Member Posts: 13
    Yes, once balls have been grounded, they should not increase in size, balls should onlyh increase in size while they fall.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    Yes, once balls have been grounded, they should not increase in size, balls should onlyh increase in size while they fall.
    You do realize that's completely different from what you said before?
    Basically, ball A spawns and hits the ground and size increases when it hits the ground. Ball B (same actor) spawns and when it hits the ground its size increases but Ball A's size also increases again.
    Okay, so that's actually easier to code. Just put a boolean in the ball actor called self.grounded and when the ball collides with the ground, change it to true. Then in your rule for growing the size of the ball, add a condition that says attribute self.grounded is false.

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

  • breubanbreuban Member Posts: 13
    Great! Thank you so much :)
Sign In or Register to comment.