[Solved] How do I make Behaviors different for two objects?

Nano Pixel

  • Posts: 1
How do I make the events for the same type of Behavior different for 2 objects... I am trying to Make an object kill the Player on collision using Die on Collision with actor type for the Player and another object I am giving a block the same behavior except give a delay in death, but when I change one it changes the other :( How do I make them seperate

« Last Edit: April 03, 2014, 02:13:47 pm by Nano Pixel »

Easy.

Make 2 behaviours.

Or, you can go into an actor > Events, and make a behavior only for that actor.

If you want something to die on collision just do this:

Behaviour > Collision with Actor > {Add a delay for 1 second} > Kill Self = Dead Player.

Check out my game here: http://www.stencyl.com/game/play/25588

And tell me if that is what you are looking for ^^.

I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!

SadiQ

  • Posts: 1795
You can make the same behavior work differently for actors in more ways.
 - You could check on which actor type it is attached to and have it work one way for that actor type and another way for a different actor type.
 -  You can have it work one way for a certain actor and another way for a different actor if you customize the behavior of each actor separately in the scene editor.
 - You can make it work differently for the same actor type if you can get certain information from the actor type (like get the X and Y position of the actor type when a collision occurs and code based on that). 
 - You can choose the actor based on their group and work with that...and I could probably write a few more methods.

There are more ways to accomplish a certain task when programming, so if you have an idea try it. If it works you can stick to it. If it needs adjustments, you can adjust or try a different method that achieves the desired result.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

*Face Palm*

Forgot all about that stuff...
I'm 17 years old, here to help and Entertain. {Also to make fun games}
ADAM: (http://www.stencyl.com/game/play/25588)
Also, if you need help making a platformer, search {Jumper} in Stencyl Forge. This is a player with everything you need in it, that i made. Enjoy!