playMaker

Author Topic: Triggered but stuck! (Float Compare)  (Read 2271 times)

mekoid

  • Playmaker Newbie
  • *
  • Posts: 36
Triggered but stuck! (Float Compare)
« on: December 29, 2014, 02:03:21 AM »
Hi
I have a cube moving on the checker board of many tiles.
I set up triggering colliders (one on each side) over the edge of each tile, so that when the cube moves next to the tile, it collides with the collider, and triggers the GO sign to let it go to the tile.

The problem is weird. When the cube moves to the other side of the tile, it triggers the other collider so that it's allowed to move back.

And this is where it gets stuck. please see the attachment.
I cant figure out. When it hits the 1st trigger, it works. But when the 2nd, it doesnt, and the cube cannot go back.

Any ideas please? thanks!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Triggered but stuck! (Float Compare)
« Reply #1 on: December 29, 2014, 03:01:12 AM »
Hi,

 Always tricky this :)

I think you should rely more on triggers than comparisions. few things:

-- make your grid trigger size different from your pawns triggers, so that when y pawn is a grid you don't have overlaps, I would make the grid triggers way smaller than pawn out of the blue and define your logic based on this. so that the pawn will EXIT a grid before ENTER a new one.

 but that may not give you the expected behavior, you may want instant detection of a pawn moving, and then you would do the opposite and make your grid perfectly in size with their triggers and the pawn trigger would be slightly smaller, so that you can detect immediatly that a pawn ENTER a new grid. this means basically only relying on ENTER and disregard EXIT for most of your logic.

If you want to have control over directions, create your pawn with childrens each with a trigger on each direction, and then work with them to know where your player is heading or define rules for direction blocks. this will be a lot easier to "visually" design then float comparisions, and perfs will be just fine, colliders are very performant.

 Bye,

 Jean

mekoid

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Triggered but stuck! (Float Compare)
« Reply #2 on: December 29, 2014, 04:00:12 AM »
Hi Jean Thanks very much for the detailed answers.

All the triggering events work fine. They are triggered properly as I expected. So the size issue seems not a problem I guess?

My intention of having the tile with 4-side triggers is to limit the pawn's movement so that when there's no tile ahead, it's not allowed to move forward.

I guess what I did should work, but somehow it's stuck at the float comparison that it shouldnt. I wonder why it does not work? Maybe it a bug?

And the reason for using the float comparison is to tell the pawn where is ok to go, if the pos X or Z of the triggered trigger is greater or less than the pawn, then the corresponding direction will have a green light to go. And when the pawn exits the trigger, it sets back to red light.

Maybe I should give up on the float comparison? Or is there a different solution?
« Last Edit: December 29, 2014, 11:26:15 PM by mekoid »

mekoid

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Triggered but stuck! (Float Compare)
« Reply #3 on: December 29, 2014, 08:05:01 AM »
I think I need this :

http://hutonggames.com/playmakerforum/index.php?topic=5198.0

But with a modification on the "Store...." value. Instead of just choosing the bool, I need an option to set the bool value to either T or F.

Can you please help me with this? Thanks so much

 

mekoid

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Triggered but stuck! (Float Compare)
« Reply #4 on: December 29, 2014, 11:41:08 PM »
I think I might try to have the triggers attached to the pawn, that's prbbly better in some ways. I didnt consider it cuz the "pawn" I have changes direction all the time. Thanks for the suggestion. Hope it works this time :D