Help Please- 3 questions: 2 about update, 1 constrain
- I'm stuck on being able to constrain my actor to my mouse x & y, and then also not allowing it to go outside of the screen.
- For example: follow my touch, but when I get to the edge of the screen leave a 10 pixel buffer from edge.
- I have the follow mouse, but not the 'buffer'.
Update Issues
1) overlap / collide seems to not be working. Any one else have this happen?
2) create to scene, create new actor, delete actor, and actors on scene do not update unless I leave the scene and return back.
Thanks in advance.
- For example: follow my touch, but when I get to the edge of the screen leave a 10 pixel buffer from edge.
- I have the follow mouse, but not the 'buffer'.
Update Issues
1) overlap / collide seems to not be working. Any one else have this happen?
2) create to scene, create new actor, delete actor, and actors on scene do not update unless I leave the scene and return back.
Thanks in advance.
Comments
otherwise make an invisible actor that covers the entire camera but nothing else. Make a new attribute called "touch inside?".On that actor put-
Rule if touch is inside-
change attribute "touch inside?" to true
otherwise
false
On the actor that you are constraining to touch put
Rule if attribute "touch inside?" is true-
constrain position X,Y to touch X,Y
Also, let this count as a bump. (I added to other parts to my post. Didn't see a need in making a whole new post)
Make a interger attribute called moveon and set it to 0
have a rule in the actor you want to drag around wen touch is pressed change moveon to 1
then in the otherwise section of that rule have a change attribute buehavior changing moveon to 0
have another rule when attribute moveon=1
constrain self position x to mouse position x
constrain self position y to mouse position y
next make a new actor call it buffer wall or whatver, set the alpha to zero, and have it set up liek walls around the edge of the screen where you want the actor to stop moving when you touch it
and lastely go back into the actor that you drag around and where you put the other rules, and make one more rule and have it when actor overlaps or collides with actor of type bufferwall
then in that rule change attribute moveon to 0
hope that helps
Tested by:
(Enemy) Rule-> If overlap or collide with actor of type 'bullet'
>> destroy
and shot enemy 500 times. and nothing.
Fixed the buffer. Made a actor that covered whole screen and constrained (records) 2 values. PlayerX and PlayerY.
Then in my "Hero" actor constrain it to PlayerX and PlayerY. If PlayerX is > or < buffer zone then constrain it to the buffer. Same is the Y.
As for the Overlap / Collide. Still nothing. Initially I had both actors set to not movable and interpolate them. Nothing happened. Then when I set one to moveable it works. Has it always been like this? I do not remember it being so.