Actor on tile detection?

BMJ

  • Posts: 278
Something else must be going on -- I just checked this in my game and it works perfectly for me. In my game, it doesn't matter if the player actor is entirely inside the other actor. If my overworld player actor is anywhere inside my overworld water actor at all,  my Boolean [In Water] = TRUE the entire time until the player actor exits the water completely, for example.  My code is super-simple, too. It's nothing more than a simple collision event (in the player actor's logic) which reads:

If [Overworld Player Actor] hits an [Overworld Water Actor]
      Set [In Water] = TRUE

Then [In Water] is set back to FALSE at the end of the 'updating' event, just as I've described above. (Again, see Liberado's method for a more versatile way of doing this).

Where are you testing for this collision? (Is it in the player actor's logic, the environmental actor's logic or is it a scene event?) Also, what are the physics settings for both of the actors in question?




« Last Edit: October 23, 2016, 08:34:07 am by BMJ »

zcstrife

  • Posts: 9
Ok it actually works, thanks!
I had the wrong event activated. In my test event working with tiles, when self hits an actor of Tiles, if data for tile at row,col= mountain, having my player's collision bounds set as sensors, it almost works, but tiles only detect collision at their borders.  A shame I could almost have it work with tiles.
Anyway this works with actors.

Thanks a lot BMJ!

« Last Edit: October 24, 2016, 12:57:55 am by zcstrife »