Hello everyone!
This is my first time both posting on the forums and scripting in Unity, but I have enough experience of programming in Java to at least get by.
I’m trying to test a random tile spawn function that will be running in real-time (so it’s not randomly pre-generated), and I’ll explain it briefly:
The player starts in the center tile of a tight formation of nine tiles. When the player enters a new tile, the same formation needs to be created around that tile, however it shouldn’t do so until the player leaves the center tile with a bit of a margin. Currently I have a trigger box covering the center tile and a bit of the adjacent tiles, so I know when the player is far enough away.
Now, the way I did this originally was with OnCollisionEnter, OnCollisionStay and OnCollisionExit, as I was testing it out with a rigid body cube that I had given a simple movement script. As I realized I may want a Character Controller instead, my method required me to use OnControllerColliderHit instead, and I was rather stumped at how to make that work.
So my first question is: are there any equivalent variants of OnControllerCollider that works like the three previous functions I was using?
Even better would be if I could have an OnTriggerExit (on my trigger volume over the center tile) that can call a function in my Character Controller to see what tile it is currently touching (and if the player is in the air, it’ll keep checking until the player is actually touching a tile). But is there any such function I could call?
Anyway, despite this minor setback of mine, I must say I do like Unity a lot better than I did UDK.
Thanks a lot!
// Rickard