TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
collide with actor actortype
Pages:
1
collide with actor actortype
readerboy7
Posts: 59
December 05, 2011, 11:36:58 pm
is there a way to do something like
if actor collided with actor [actor type] at more than speed of [attribute]
with code blocks?
if without code blocks, please also tell me how to switch animation in actionscript.
thank you.
rob1221
Posts: 9471
December 06, 2011, 12:00:45 am
Yes you should be able to do that but the question is how to determine the speed at the time of impact. If the impact slows down the actor, then you may not be able to get an accurate number for speed (you'll have to test that out). I suppose you could make a larger collision shape and then make it a sensor that detects the imminent collision and records the speed at that time.
https://twitter.com/Rob1221dev
readerboy7
Posts: 59
December 06, 2011, 04:01:19 pm
sorry, i guess i said it wrong. if there is a way, please tell me.
by the way, the object in question is a sensor.
sebsebmc
Posts: 27
December 06, 2011, 04:22:39 pm
If its a sensor detecting a collision then there should be no problem.
Its possible, but the speed part may raise an issue if its coming at a diagonal, because you only have access to x and y speed.. my example will say that its x-speed if more than 16 but you can substitute it with whatever you need.
In a behavior under collision it goes something like this
« Last Edit: December 06, 2011, 05:05:52 pm by sebsebmc »
rob1221
Posts: 9471
December 06, 2011, 08:24:56 pm
Speed is fine to use; you'll just have to do some math with X and Y to figure out the current direction (sorry I don't know the formula but I know it's on the forum somewhere).
https://twitter.com/Rob1221dev
Pages:
1