playMaker

Author Topic: Triggers and Colliders  (Read 4722 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Triggers and Colliders
« on: July 20, 2015, 05:34:02 AM »
Hi!

I use a ground trigger on my Player to check if it's falling from a platform edge.
And it's working, but it's one problem:
When I have many tiles, this trigger runs every time the Player walks over the tiles because they have separated colliders.
Is this a Unity or Playmaker problem? It's not a user problem.

Look at the screenshots.

Is it a way to solve this?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rhyuzaky

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Triggers and Colliders
« Reply #1 on: July 20, 2015, 07:05:03 AM »
Man, Is there any separation in these tiles?
If there is, you simply create a trigger in the feet that take the tiles.
If there is no answer me and see if I can help ok?

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Triggers and Colliders
« Reply #2 on: July 20, 2015, 08:39:20 AM »
Hi!
Every tiles has their own colliders.
I'm not sure if I know exactly what you mean.
I have a trigger which is position bellow the feet, but this trigger checks when the player falls from a platform edge, so it can run the animation falling not only after a jump, but also when it falls from a platform edge.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: Triggers and Colliders
« Reply #3 on: July 20, 2015, 09:10:49 AM »
I cant see too much in your smart images, so cant see what you try to do, but...
If you like to use tile based map and this map is fix, so not change in runtime, better if you create an empty gameobject and add a box collider component on to this empty gameobject and resize this collider size on to the map tile group.

So better if you use just one collider for a group of tiles.
Separate the graphics and colliders.

With this you also can get some plus speed for the game what is maybe not important at now, but if you like to make larger maps, it will be good.
« Last Edit: July 20, 2015, 09:13:13 AM by Bqlqzs »

Rhyuzaky

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Triggers and Colliders
« Reply #4 on: July 20, 2015, 10:39:13 AM »
What I meant and you increase triggers the feet of character for this bug does not occur.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Triggers and Colliders
« Reply #5 on: July 20, 2015, 07:51:58 PM »
Quote
I cant see too much in your smart images, so cant see what you try to do, but...
If you like to use tile based map and this map is fix, so not change in runtime, better if you create an empty gameobject and add a box collider component on to this empty gameobject and resize this collider size on to the map tile group.

Don't you see in the FSM that the player is grounded in the first image and not grounded on the second image and so on?

I know I can use one big collider on a group of tiles and I'm going to do that if I don't find a solution for this.
It will be another problem if I use one big collider. It's impossible to destroy the tiles. For example to place a dynamite on the tile and then the tile will destroy and respawn after some seconds. So I want to know a solution to create a tilebased platformer with separated colliders without any problems with the colliders.
Well, it's not a problem if I don't use a falling animation on the player and the player can't jump.

Quote
What I meant and you increase triggers the feet of character for this bug does not occur.

I use a trigger to check the ground. And I don't think this is the problem.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rhyuzaky

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Triggers and Colliders
« Reply #6 on: July 21, 2015, 09:28:52 AM »
Man, offers the project to see if I can help.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Triggers and Colliders
« Reply #7 on: July 22, 2015, 03:06:08 AM »
Hi!
I Use Raycast instead of trigger to detect the ground, because Raycast doesn't detect the ground when tiles are snapped together, like triggers does. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no