
I tried to build a little breakout-game but I miserably failed at the beginning.
(I know that there are probably tons of them inworld already, but I wanted to try it anyway).
I made a frame of 4 walls, named them «top/bottom/left/right».
In the «ball» I made a «collision_start»-event, triggering when it hits one of the walls, giving the ball a new direction.
I use llSetForce() to make the ball go up (starting at the bottom of the frame).
Problem is, as soon as the ball hits the top of the frame, it begins to «roll» on it, messing up the local coordinates of the ball. So when collision_start finally fires and the direction is reversed, the ball goes in total arbitrary directions.
I tried to use llSetTorque(ZERO_VECTOR) and llSetLocalRot(ZERO_ROTATION) and llSetRot(ZERO_ROTATION), but nothing helped - the ball «rolls» as soon as it hits one of the frame's walls.
As I'd rather have a steady movement without anyway, I tried it with llSetPos() as well, using a ball that's not physic - but this ends up in a rather awkward movement, so I guess I have to go with a physic-obect...
Any suggestions?
[EDIT]
Seems like collisions in a link-set don't work the way I expected. The value I get from llDetectedName(0) in the collision_start-event was always «bottom»...?