Magnet system, please I need help!
Hey,
I wanna have a magnet function in my game. So when the magnet is collected, the coins get constrained to the main character and because of that also collected of corse. My coins physic moveable is now turned off because of memory usage reduce. What I tried was:
when magnet collides with main character
set magnetON? to true
in the nuts prototype I had:
when magnet is true
change physics moveable on (otherwise false)
constrain self.distance to magnitude(playerX,playerY)
when magnet is true
self distance < 768 (iPad)
move to playerX, playerY ..relative to scene
The problem I have is that the nuts do not move at all and when the magnet is turned off, they are anywhere^^...
I know how to solve the position problem but not the other issue, I tried a few things but nothing seems to work at all.
Thx, really appreciate any help!
Alex
I wanna have a magnet function in my game. So when the magnet is collected, the coins get constrained to the main character and because of that also collected of corse. My coins physic moveable is now turned off because of memory usage reduce. What I tried was:
when magnet collides with main character
set magnetON? to true
in the nuts prototype I had:
when magnet is true
change physics moveable on (otherwise false)
constrain self.distance to magnitude(playerX,playerY)
when magnet is true
self distance < 768 (iPad)
move to playerX, playerY ..relative to scene
The problem I have is that the nuts do not move at all and when the magnet is turned off, they are anywhere^^...
I know how to solve the position problem but not the other issue, I tried a few things but nothing seems to work at all.
Thx, really appreciate any help!
Alex
Comments
I haven't tried something like this for a while but in the old days actors would seem to move a bit even when they shouldn't ... so if that happens another option would to be to keep the Moveable OFF actor and then switch it out with an identical actor with moveable ON at the time the magnets effect should take place.
Can you explain the second option more detailed. Can't follow it right now,
Thx
When the player fails, my scene doesn't reset with the behavior, I worked out my own system but when this happens, the "run to completion" is still active even though the effect is turned off. How can I get this to work?
Thx
( EDIT )
I got it to work
Alex