collide with actor actortype

readerboy7

  • Posts: 59
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
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.

readerboy7

  • Posts: 59
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
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
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).