Have actor stick to current position
![UP](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi all,
I'd like to be able to click on an actor (falling ball) and
when clicked on it should stick to it's current position.
I was trying this by adding a rule saying;
when actor receive event > mouse button > down > Change Velicity to 0
Kind of works, but the ball won't stick when I release the mouse,
I also have the impression it only stops moving for a very brief moment.
Any idea how to fix this, to click + stick?
Also, I'd like to be able to double click on a ball that's stuck and have it disappear (eventually with a blowing up effect or something). Any pointers to how I can double click + destroy??
Thanks a lot for any input!!
I'd like to be able to click on an actor (falling ball) and
when clicked on it should stick to it's current position.
I was trying this by adding a rule saying;
when actor receive event > mouse button > down > Change Velicity to 0
Kind of works, but the ball won't stick when I release the mouse,
I also have the impression it only stops moving for a very brief moment.
Any idea how to fix this, to click + stick?
Also, I'd like to be able to double click on a ball that's stuck and have it disappear (eventually with a blowing up effect or something). Any pointers to how I can double click + destroy??
Thanks a lot for any input!!
Comments
Nope no gravity, everything falls down by acceleration, so I'm good so far.
But I'm sorry to say I'm kind of lost trying to follow your advice.. :-(
(only my 4th day playing around.. and I'm such a code dummy it's insane!)
Would you mind to guide me though this in a little more detail,
I don't want to ask for too much though.. Thanks so much!
Sure it's not a biggie at all, but with my knowledge, ouch...
Should be able to figure it out though,
I'll be back :-)
But the ball starts moving up slowly when I click it, it doesn't stick to the position it's at.
The self.move attribute I created in the actor is a REAL type attribute, value = 0
does that make sense?
Then I have the first RULE attibute/self.move/0 + Accelerate 270° relative to screen, making the ball fall down nicely,
and the second RULE Actor receives event / touch / pressed > Change attribute/self.move/1
Any idea where I'm going wrong?
I made a self.move
if self.move is true => accelerate
then and turn self.move to false, and continues accelerating.
I tried to change the drag to 1000, the Linear X & Y to 0, interpolate X & Y to 0, in 0,5 sec. but non really work. the interpolate kind of works, but it doesn't stop it immediatly.
There has to be an easy and simple way.
Thanks
Sebastian