As discussed in my thread
http://community.stencyl.com/index.php/topic,36481.0.htmlpeople get confused about the "direction of actor" block, thinking it returns the direction it is moving in, when it actually returns the direction it is facing.
Currently the way to get the former is:
atan2(yspeed of self, xspeed of self) as degreesIf you use this on a Last Collided Actor, you will get its
post-collision velocity direction, not the
pre-collision direction.
To get the latter, you need to make an attribute that takes this value and is updated every frame (via an "always" event) and use that attribute (in the frame at which collision occurs, this attribute has the pre-collision data).
However, since the physics engine already knows this information (or else it would not work!) it is inefficient to compute it ourselves.
I suggest removing this inefficiency by creating a block that gets this information from the physics engine. To distinguish between the facing direction and velocity direction, the two types of directions should be named that way in their blocks.
Furthermore, when using Last Collided Actor in a block, it should allow choosing whether you want that actor's pre-collision velocity or post-collision velocity.
Then, instead of the convoluted, counter-intuitive, and inefficient solution I used, one could simply say
"set vector direction of last created actor to pre-collision vector direction of last collided actor"