Need to know how players can move objects around ingame
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!
Example: I want them to tap and move a object/s to a location.
Any help would be excellent!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Comments
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
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
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?
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?
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Rule:
Actor receives event - touch - inside.
Constrain Attribute: self.Position.X - self.Position.X
Constrain Attribute: self.Position.X - self.Position.X
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Good luck
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