help with behavior please

aroncruce

  • Posts: 214
I am very new to stencyl and have no coding experience. I want this behavior to kill my actor when hitting another specific actor at a certain speed or from a certain height. Any help is greatly appreciated! thanks in advance.

The8BitMan

  • Posts: 424
Code wise there is nothing wrong with what you've. If your game is on iOS make sure you save it before testing. If that isn't the problem can you please explain more what the outcome is?
Need music, graphics, scripts? Just ask!

aroncruce

  • Posts: 214
If the actors speed is greater than 0 ( or w/e number I choose) but it doesnt work. I started the speed of y at 20 and worked my way down to 0 and the actor wont die.

dtrungle

  • Posts: 1938
Make sure the collision is actually detected. Maybe you need to make one of them a sensor so that the instant they collide the speed won't go to 0 which makes the condition false.

aroncruce

  • Posts: 214
I understand so it could be calculating the speed to late, now I just need to figure out how to make a sensor! thanks!


aroncruce

  • Posts: 214
sweet that seemed to work fine, but I would have to layer tiles infront or behind the actor because the sensor makes the actor fly right through. Would it be more efficient with memory to do the same thing with regiions? I dont know how memory intensive one is over the other?

dtrungle

  • Posts: 1938
Regions would cause more pain. I don't quite understand, the condition should kill it on contact, it shouldn't have time to fly through.  ???

aroncruce

  • Posts: 214
yes this is true, but I want it to have the condition where if the speed of y is low enough the actor wont die. The biggest issue I am having is that I have a consistant x speed and I think the behavior is getting confused between the two.

dtrungle

  • Posts: 1938
You can detect the 'low' speed and apply force so that the two colliding actors push away from each other. I don't think x-speed and y-speed can be mixed up by the engine.

aroncruce

  • Posts: 214
fair enough I will try that tip, thank you for all of the help! This community has been extremely helpful for newbs, I just wish there were more tutorials on building different behaviors so there wouldnt be soo much trial and error!

thepopeisgod

  • Posts: 13
If you are still having issues with collision and can't get it to work you could also try creating a region the same size as one tile, around your actor.  something like this.

This is kinda what I had to do in some earlier versions of stencyl.

aroncruce

  • Posts: 214
perfect thank you very much, I'll give this a whirl and see if it works better for me. I am still having difficulties detecting y speed

aroncruce

  • Posts: 214
just in case anyone was wondering or had a similar question in the future this is how I got it to work. Although I plan on changing it to a scene behavior though. Does anyone know where to get good info on creating joints, I do not know what I'm looking at in the ragdoll demo?!!!!

« Last Edit: April 22, 2013, 08:42:47 pm by aroncruce »