Is there a way to constrain an actor to a specific grid?

msoulammsoulam Member Posts: 2
edited September 2012 in Working with GS (Mac)
Hi there, I have been struggling with this for a while. I have an actor who is dragged by touch. I want it to go anywhere on the screen but be restricted to specific points.

This is a maze that doesn't only go up-down-left-right (hence, Min Max wont' do it), but also diagonal in no specific angle.
I can create a list of coordinates (ex: X=104 y=211) and put it in a table but how do I tell Gamesalad that the actor is restricted only to these pairs of coordinates and cannot stray from them?

Any idea/thought is welcomed!!!!

Best Answer

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you saying that you should be able to drag the actor anywhere but once you let go, it snaps to a point? Or are you saying that you can only drag along a path suggested by the points?

    If you're looking to snap to a point, what about having an invisible actor centered at each point and then having a rule on the draggable actor that snaps to that point when colliding with the invisible actor?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • msoulammsoulam Member Posts: 2
    I am looking to drag it along a specific path and not let it get off that path.

    I have done the invisible Snap Actor and placed them along the path, but if you drag the actor it lets you get off the path and then it is just stuck... Changed both actors' physics to not allow them to be so "light" but that did not help either.
  • msoulammsoulam Member Posts: 2
    You know, this may actually work. I need to give it a try. Thanks so much!
Sign In or Register to comment.