Actor constrain to touch position lags/drifts off
I have tried to find similar problems here but couldn't find a solution. I have an actor that simply needs to stay "under the finger" at all times, but as the screen scrolls the actor falls behind.
Also after release when I click it again it "jumps back" to an earlier point.
What is going on?
Also after release when I click it again it "jumps back" to an earlier point.
What is going on?
Comments
The point is I need the actor that the player controls by touch to be floating along with this speed. This is easily achieved by putting the player controller actor on a separate non scrollable layer... only my problem is... it doesn't interact with the other actors on the other layers anymore but it needs to for the game mechanics...
How to solve this? I have a form of auto-scroll and all need to have is the actor truly stick under the finger, even if the finger is not moving - then then auto camera scroll defines the position basically.
(On top of this I also define areas to increase or decrease camera scroll speed to give a feeling of flying faster with a ship - middle of the screen is slower than closer to the edge etc. but again the ship has to stay "under the finger".)
Help is GREATLY appreciated...stuck on this...
P.S. I also have rules that say that on touch release the actor does things which don't happen because the actor and finger get separated ...so when you release the finger GameSalad doesn't count it as "release from the actor."
How can I make this work? If I put the actor on the scrolling layer he falls behind when I keep the touch pressed and in one place and so the actor "lags" behind.
As for your touch release problem, I personally don't understand what you mean: when you release your finger and so it's separated from the actor, that IS touch release, so your Rules should be working with When touch is released.... or perhaps I've misunderstood...
----------------------------------------------
http://davidgriffinapps.co.uk/
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
The other approach still troubles me, here is what I did:
Constrain actor X to touch
Have an invisible actor Y move the camera to the right as soon as X was touched (and stop if X was released)
So Actor X was moving along the scene (a long one) but it would not stay where the touch was, it would "fall behind". Consequently when "released" it didn't trigger "release" anymore because Actor X slipped from under the touch.
I guess everybody solves this by moving the background rather than the camera + actor movement. I am still curious if I did something wrong or if that simply doesn't work in GameSalad.
Hyroscope: if I put this Actor X in a layer above all the other objects in a separate layer they can still interact? I had actor X destroy when it would overlap/collide with some of them but it seems that didn't work.
Okay I just tested various scenarios and it seems there is some weird bug in GameSalad... sometimes the actors in different layers suddenly stop interacting... and I don't see why.
All I am doing is having actor X (player controller) change an attribute to "touched" and have the camera actor start moving to the right and controlling the camera as soon as this attribute is triggered.