Puzzle (floor type)

hi all,
new here so thought i’d ask your advice on something.
we are creating at university an RPG game. now through my level (2) prototype i have a maze within a temple.
now we have to create puzzle features and one of my ideas was to use the indianna jones iohova path as inspiration.
basically there is a floor with tiles, and if the correct path is not followed then the tile will fall from underneath you and you will either a, vanish in a puff of magic smoke or b. fall into a pit and then have to respawn.:slight_smile:

i hope you could help advise me on the best way to go about this as i would realy appreciate it.
many thanks all :slight_smile:

Sounds simple enough.

On the tiles that drop, add a script with OnCollisionEnter()
a) They should initially be set to Kinematic, which you turn off so they drop due to gravity.
b) Spawn your puff of smoke, etc.

Destroy or Respawn anything that drops below a certain Y value.

ah, many thanks callahan

im not excellent with script yet so ill use the javascript.
so basically the tiles need to have an onCollisionEnter() script that says when player collides then the tile drops?

I think, that was his point.

Possible would be:
Tile.js:

var thisTileIsCorrect : boolean; //Here you set, if the tile belongs to your Path, or not.

function OnCollisionEnter(collisionInfo : Collision)
{

    if(!thisTileIsCorrect)/If the Tile does no belong to the path, then...
    {
//Here you could insert a check, if the colliding object has a  PlayerControlScript or similar attached, if there are more Objects that  can collide with your tiles... You could use 
//for (var contact : ContactPoint in collision.contacts) {
//    if(contact.otherCollider.GetComponent(YouPlayerScriptOrWhateverYouWantToCheck))
//    {
//        //Fall Down
//        break;//And Exit the loop
//    }
//}
        //Activate The kinamatic here, to let the tile fall down...
    }
}

THis code is written directly by heart, but it should work more or less…