TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
Books & Courses
FORUMS
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Chat
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
help with behavior please
Pages:
1
help with behavior please
aroncruce
Posts: 214
April 19, 2013, 11:28:44 am
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
April 19, 2013, 12:34:00 pm
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
April 19, 2013, 03:16:47 pm
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
April 19, 2013, 03:23:00 pm
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
April 19, 2013, 03:24:38 pm
I understand so it could be calculating the speed to late, now I just need to figure out how to make a sensor! thanks!
dtrungle
Posts: 1938
April 19, 2013, 03:33:25 pm
http://www.stencyl.com/help/view/collisions-and-groups/
Scroll down.
aroncruce
Posts: 214
April 19, 2013, 03:42:16 pm
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
April 19, 2013, 03:46:08 pm
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
April 19, 2013, 04:09:12 pm
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
April 19, 2013, 04:30:26 pm
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
April 19, 2013, 08:19:17 pm
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
April 20, 2013, 11:26:50 pm
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
April 21, 2013, 03:52:41 am
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
April 22, 2013, 08:36:56 pm
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 »
Pages:
1