GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Drag Collision HELP!

JustTooSmexiJustTooSmexi Posts: 7Member
edited November -1 in Tech Support
I have a game where my actor has to touch another actor in order to get to the next level, with obstacles. One of the obstacles is a wall, but since my actor is being dragged it goes right though it and bounces off the other side, with collision turned on, someone please help! thanks (:

Comments

  • entersimonentersimon Posts: 269Member
    I'm going to assume by drag, you actually mean constrain. Drag is a physics property in GS. If I'm wrong in my assumption then disregard what I'm about to say.

    You can make a rule that says if your actor overlaps or collides with the actor of type wall, interpolate position to self.position x to self.position x - 5 (or whatever you want for the bounce effect.

    Then in the otherwise put the constrains you're using to "drag" the actor.

    Unfortunately it's not completely clear what the exact problem is, so if what I wrote doesn't fix it, write out a more detailed summary and either I or some other friendly GS user will be happy to help you out.

    Best of luck!

    :^)

    Check out my daily app development blog at TheIndieDev.com

  • JustTooSmexiJustTooSmexi Posts: 7Member
    Well im using constrain attribute, self.position x is equal to game.touches.touch 1.x and self.position y is equal to game.touches.touch 1.y which enables the player to drag the actor, but for some reason when they drag it, it goes right through another actor (a wall i made) thanks for the quick reply, I will try what you said thanks (:
This discussion has been closed.