Dangerous floor (Could use some help)

so basically I’m trying to have it so when the main character jumps on a platform floor turns into Spike so he can’t touch the floor again but I can’t get the messaging to work right this is in my game Wapiti run to lose the link Flowlab Game Creator - Wapiti Run II the names of the objects are gold floor and moving platform those are the ones that I need help with the programming

2 Likes

could you guys help @hihilogic @John_Shrekinson @JR01

2 Likes

Because you need to tell the message where to send it to,
the type should be gold floor

4 Likes

I tried that earlier but I’ll try it again

2 Likes

Ok this is wrong, wrong, wrong :upside_down_face:
Sending a message to the gold floor type will send it to EVERYTHING that is a gold floor. Instead, use a collision in the gold floor to collide with the player. Then connect the collision with a switch (default set to ON), and have the OUT going to the switches own OFF and a timer (because we want to give the player time to react before spikes pop up), then have the animation connected to the timer. Next, connect another switch to that collision. Set it to OFF on the default. On the OUT, drag in a block that restarts the level. Go back to the other section of code, and connect the OUT of the timer to the ON of this other switch.
This is what your code should look like:

Also, refrain from using UI alerts when colliding with death objects. This makes the game not flow well, and it’s better to just have the character die instantly :slight_smile:

1 Like

Ok, this is a better version that uses raycasts instead of collisions (make sure to set the raycast angle to 270):

Or you could use this one with proximity:

In this one, just mess around with the proximity settings until you feel it works best.

1 Like

You can also add a timer AFTER the timer in the raycast and proximity to set the bottom switch to ON so that the player can actually see the ground animate before their untimely death :upside_down_face:
You should preferrably set the timer to something like 0.1

1 Like

I think you have to make the object movable in physics

1 Like

I think they don’t. Making it movable would make it so the player could physically move the object, bouncing it around the screen. Not natural. It would also be affected by gravity, meaning it would just fall out of the level. Also not natural.

1 Like

oh ok

1 Like