Constrain actor to another and move with touch
UltraLionBlu
Member Posts: 157
Hi guys I used Constrain Attribute to join 2 actors then I put the rule to move them with the touch.
There is a problem when I move them their union does not remain precise but "it is a dancer" when I move the blue actor the red actor seems to follow him with a certain delay. it's probably a very simple thing for you but I can't understand is there a way to fix it? thx all!
Comments
Hi again guys the topic can also be closed. I did it using motion linear velocity !!! Thanks anyway to everyone who has wasted time reading XD
Sorry maybe I will schizophrenic but I sang victory too quickly. the method I used brings me problems, so I go back to the first question, how can I constrain 2 actors so that they stick together without small delays?
I specify that the actor to be joined to the other should not already be present on the scene. But it would spawn at some point
Is it a strange bug? It seems like an elementary thing
I can't open your files. They just get converted to how constrain.zip.cpgz.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Maybe because it's compressed with winrar to link it I had to change the rar extension to zip, maybe if you rename it from .zip to .rar it opens but only if you have winrar?
I try to post it with compression directly in .zip
That worked.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I see what you mean and I don't know how to fix that. There is a lag when dragging an actor and having another actor constrain its position to the dragged actor. So they aren't perfectly lined up while they are moving.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
this does not happen when constrain is used in an actor moved with the keyboard but as we know on smartphones the keyboard is not used and this seems to me a very large defect precludes the possibility of creating a myriad of games maybe I should report it as a bug but who knows how much will be solved ..: / thanks anyway
Hi, I made an update to this project and it works okay now. I'm not sure the 'fix' will fit your needs though.
Instead of constraining the movement of the two actors to the saved X and Y coordinates I've constrained them to the mouse/touch location while dragging. There is no lag then. I have no idea why there is such a lag with the other method...
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
it may be that in between the processing of the two actor behaviours, there’s a bunch of logic being processed causing a delay.
Great Jamie! The only way I had found was to use the instances and force them to the actor through the scene, but it was very uncomfortable, your system I have yet to try it with the rest of my work but it looks much better!
ps it is also thanks to you if I use gamesalad I was not convinced to jump into this adventure and I saw some tutorials before, for example yours to create the platform explain very well Thanks!
@UltraLionBlu, great. I'm glad I could help. I just threw that together quick as a test so you might need to play with it some to create a larger project with it. Thanks for the kind words about the other tutorials, I'm glad they helped too!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page