Detecting whether player is driving on the wrong side of the road

Any help would be appreciated as I’m not too sure on how I’d approach this, I’m considering adding a long freeway into my game but to stop people from ruining player experience I’d like to prevent them from driving on the wrong side of the freeway.

you can put an invisible part with can-collide on that covers the wrong side of the road

Yeah I was just going to say add an invisible transparency 1, collision on part so the player/car can’t pass the divider

It’s pretty simple actually. You can use a vector dot product to determine if the character is on the right side of the road or not. Check out the video below. I have attached the example place file as well.

roadDividerExample.rbxl (25.8 KB)


That is great! But what about detecting the way the vehicle is facing? I’m thinking of using lookVector but I’m not too sure.

Well, I imagine the character faces the same way the vehicle does when driving. Otherwise, just give the vehicle model a PrimaryPart that has its front surface facing the right way.

till this day time dictates why he didnt get the solution mark

you are a good Samaritan my friend

he has received his solution after 3 years :sob:

NO WAY!!! IT WORKS!!! :happy4:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.