how can i measure the velocity on actor?
Howdy
I am trying to figure out how i can get the following to work:
I want my A actor to destroy my B actor.. however i want this to be done at a convincing velocity.. so if actor A hits actor B at to low a velocity actor B will not break.. but if actor A hits actor B at a high velocity actor B will break... then breaking 10 B actors will unlock the next level...
so how can i measure the velocity on actor A and then have that measurement tell actor B to either be destroyed or not?
any help is really appreciated
Thanks
I am trying to figure out how i can get the following to work:
I want my A actor to destroy my B actor.. however i want this to be done at a convincing velocity.. so if actor A hits actor B at to low a velocity actor B will not break.. but if actor A hits actor B at a high velocity actor B will break... then breaking 10 B actors will unlock the next level...
so how can i measure the velocity on actor A and then have that measurement tell actor B to either be destroyed or not?
any help is really appreciated
Thanks
Comments
In Actor A
Rule - when Actor A collides with Actor B
change attribute game.velocity to sqrt((self.motion.linear.velocity.X^2)+(self.motion.linear.velocity.Y^2))
In Actor B
Rule - When collides with actor A
------Rule When game.velocity is > ????
--------Destroy Actor
in the part sqrt which parts sets the velocity? is it ^2 and is this adjustable? and does this measure the velocity the actor has before it impacts with the other actor?
i ask because when i run this A hits B but B bounces up and hangs in mid air.. how ever if i change the > to < it will break actor B
thanks
i still get the same result though.. ( actor B bounces and floats around...where it should destroy and play destroy animation) so i am really not sure at which velocity the ball is traveling whether i say is greater then 1 or 500 the actor wont break.. only when i do a is less then...
Orbz, is that velocity= magnitude.. do i put that in actor A or B?
totalVelocity = magnitude(linX, linY)
it's direction of travel can be calculated as such:
direction = vectorToAngle(linX, linY)
at which point does it know actor A is moving to slow so it will not destroy actor B?
I'll publish the demo in a bit, after I get some feedback on how to publish just a demo and not an official game.
You can find it under 'velocity demo'. Hope this helps some.
thanks a million!
If for some reason you can't get that, I'll post the file online.