Need to know how players can move objects around ingame

Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
edited November -1 in Working with GS (Mac)
Hey, i need to know how a player can move a object/s around ingame.
Example: I want them to tap and move a object/s to a location.

Any help would be excellent!

Comments

  • youngster9youngster9 Member Posts: 326
    Make a rule
    When tap is inside interpolate self.x to whatever you want and self.y to whatever you want. If you want a drag type effect you could constrain self.y to touch.y or self.x to touch.x if touch is inside Don't do both because then it can go anywhere.

    Hope this helps if you need me to make it more clear just ask
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Yeah, if you can make more detail that would be amazing. I would give ya 5 start for answering so quickly, and if it works. ( i would give ya 5 stars if i could xP)
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Like how do i get to interpolate self.x to self.y etc. Im new if you couldnt tell :P
  • youngster9youngster9 Member Posts: 326
    Rule:
    When touch is pressed
    Interpolate self.x to device.touch.touch1.x (something like that)
    Interpolate self.y to device.touch.touch1.y

    With this when a person taps the object will move to that point in a set time.

    If you just want it to teleport then use change attribute instead of interpolate.

    If you want to have it that the user must drag the object to the location then make a rule
    Rule:
    when touch is inside
    constrain attribute self.y to device.touch.touch1.y
    constrain attribute self.y to device.touch.touch1.y

    Does this help?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Okay, i would like the object/s to have the player move them:

    Rule:
    when touch is inside
    constrain attribute self.y to device.touch.touch1.y
    constrain attribute self.y to device.touch.touch1.y

    But i got the constrain attribute and i see 3 little dots '...' inside a little box, do i click inside that? And if so, how do i navigate to the self.y?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    I now have this:

    Rule:

    Actor receives event - touch - inside.

    Constrain Attribute: self.Position.X - self.Position.X

    Constrain Attribute: self.Position.X - self.Position.X
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Braydon_SFX said:
    I now have this:

    Rule:

    Actor receives event - touch - inside.

    Sorry im new at this.

    Constrain Attribute: self.Position.X - self.Position.X

    Constrain Attribute: self.Position.X - self.Position.X

  • svnsvn Member Posts: 445
    I'm pretty sure Tshirtbooth has a video on YouTube for this kind of thing. Sorry I can't be more specific.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You Really need to read everything in the support info from the support Tab. and then watch all of the videos in the GameSalad cookbook (Link at the bottom) And don't just watch the videos. Watch them Then watch them again creating the projects. Then try to create the projects from memory. You have to to crawl before you can walk and you have to be willing to help yourself For people to be willing to help you. It will get old very fast if you are coming here with questions that could easily be solved from one of those sources. Im not trying to mean and tell you not to ask that certainly the point of the forum. But the biggest mistake I see people make is trying to do anything with the Tool before they have even learned the Basics of the tool.

    Good luck
  • XizaxXizax Member Posts: 46
    I used this you may use interpolate if you like but here is what i did `Rule
    when actor receives event touch is pressed
    change attribute self.position.X to game.mouse.position.x(this is not a custom attribute)
    change attribute self.position.Y to game.mouse.position.x(this is not a custom attribute)`
    dont worry about no touch or mouse.position they both work on the macs, ipods, iphones, and ipads
Sign In or Register to comment.