GameSalad

Howdy, Stranger!

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

(Re Post) Need help with same actors colliding.

rickynikorickyniko Posts: 85Member
edited November -1 in Working with GS (Mac)
Ok, so in my game, the actor pushes around crates to get through the maze, so what i want to happen, is that if one crate collides with another, i dont want the player to be able to push them BOTH in the same direction at the same time.(what happens is, the player pushes the crate, and when the crate hits the other crate, they both move in the same direction.) is there a way to stop this form happening?

(applying drag just makes them shake crazily when the player isnt moving them around)

thanks

Comments

  • chosenonestudioschosenonestudios Posts: 1,714Member
    use different actors.... you could do this with rules, but it would be heavy logic.... And its just not necessary :)
  • rickynikorickyniko Posts: 85Member
    chosenonestudios said:
    use different actors.... you could do this with rules, but it would be heavy logic.... And its just not necessary :)

    ive tried using different actors but im not sure what rules to put in, im kinda newish
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    I was thinking of having a "sensor" actor that checks the area in the direction you are trying to move your player to see if there is more than one block present. I do something very similar in the puzzle game I am working on and it works like a charm...
  • rickynikorickyniko Posts: 85Member
    barkbark00 said:
    I was thinking of having a "sensor" actor that checks the area in the direction you are trying to move your player to see if there is more than one block present. I do something very similar in the puzzle game I am working on and it works like a charm...

    sorry, i dont quite understand :S
  • BarkBarkCoBarkBarkCo Posts: 1,400Member
    You would need to constrain your players x/y to a set of game attributes.

    Then you would create a smaller invisible actor that would spend most of it's time would spend most of its time constrained to the player's x/y. However, when you try to move your player, it would first send signal to the "sensor" that it need to scout out the area that your player intends to move into, at least the width of two crates. The sensor would track how many crate actors it overlapped and if the number is < 2 it would report back to the player that its is OK to move in that direction.
This discussion has been closed.