Is there an easy way for me to code something that checks what the current slice velocity is, then reverse it's velocity? My boomerang slice is already parented to my hero so no matter where I move I know the boomerang will always return to me, so that part is taken care of.
I noticed "get slice velocity x (handle)..." in the dictionary but it does not have a section that describes how it works really. I'll play around with that for the time being but please respond if you can think of an easy way to carry this out.
EDIT: As a first attempt I made a timer, once the timer is up the velocity is supposed to switch directions. These are the functions I used. It compiled but there seems to be no velocity in the opposite direction seen.
Code: Select all
#This is meant to get the original velocity, then set the new velocity of the
#slice so it is negative (in the opposite direction...
set slice velocity x (Boomerang, (0 -- get slice velocity x(Boomerang)), 10)
set slice velocity y (Boomerang, (0 -- get slice velocity y(Boomerang)), 10)