Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can you detect which side a player touched?

Asked by 5 years ago

How is it possible to make those clouds like in Bubble Gum Simulator where if you're flying up you wont hit the cloud and fall down but if your on top of the cloud you can walk on it.

I could think of a way and that is just detecting if the player touches it twice then make it CanCollide = true but that is extremely bad as what if they are falling down and touch it for the first time?

It's like if they touch the bottom of the cloud they can go right through it but if they touch the top they can walk on it.

I'm not asking for any code, just a basic explanation because I'm curious how those games made it.

0
If the player's position is under the cloud, make it CanCollide false. If the player's position is above the cloud, make it true. joritochip 705 — 5y
0
^ this guys smart. thats a lot of clouds to be constantly checking through though. DinozCreates 1070 — 5y
0
I know there is a better way than to constantly loop. YabaDabaD0O 505 — 5y
0
check every time the players height changes? DinozCreates 1070 — 5y
View all comments (3 more)
0
I guess this works, but there is a problem. What if there is multiple people playing and trying to go up past the same cloud? YabaDabaD0O 505 — 5y
0
do it on the client? DinozCreates 1070 — 5y
0
maybe 2 parts one at the bottom touched both of them cancollide off top one nothing HappyTimIsHim 652 — 5y

Answer this question