- Home /
How can i stop a WASD Cube Player to move into nothing on a plattform?
im new to Unity and im looking for a way to check if there is a path/ground when i roll my cube player in a direction so he won't move on a place without ground. sry for bad english
Answer by cgklutts · Dec 22, 2019 at 11:47 AM
If your game is ultimately going to be as simple as the image pictured above and the ground is always going to be flat cubes.. the easiest solution would be to add colliders to the platform to make it to where the player cannot walk off.. Create empty game objects on the platform as children and on the empty game objects add colliders...
maybe i do somethong wrong but when i create empty borders he just get pushed away in the air by them... since i cant use gravity and i really let him rotate on the edges(ins$$anonymous$$d of just an animation) i guess its not working...
do you have any idea how i can stop the movement by coding? i tried to show you my $$anonymous$$ovement Script but im to stupid to paste it in here.. e.g. by deactivate the keyfunctions when there is no ground..
Answer by Cratuss96 · Dec 23, 2019 at 07:27 PM
îsn't there any option or function where you can check if there is an plattform object in the direction i want to move? i think coliders dont help much because my cube just get pushed into the air by them..
Your answer
Follow this Question
Related Questions
How to make a Cube Roll in JS in direction of camera? 1 Answer
Detect the up axis when rolling a cube? 2 Answers
moving a cube 2 Answers