I need to detect if there is a property ground below the character… So I used an empty (parented to the character) and a ray sensor, but unfortunately didn’t work…
I read that RayCast was the solution, but I don’t know what is that…
Could anyone please tell me what “RayCast” is and how it can help…??
:eek::eek::eek::spin::spin::spin::eek::eek::eek:
Thank you for the reply… But this is not the solution… If I do that, then I will have to separate the walls from the ground, which is very hard in a big scene and also increases the faces of the scene…
yes you’re right. and using a near sensor is the same problem?! Am i right? maybe you could add a child plane under the character that has a touch sensor, so it won’t jump when its just near a wall
When asking for help, post a blend too, as there could be many things wrong.
To give you an idea, this is a logic block demo: The ray logic block is facing downwards (-Z) to a distance of 5 units. When this detects a property ‘ground’ (the plane) plus the player presses the space key the ‘and’ block will fire and the motion actuator pushes you up.
You can also set this logic block to detect materials too.
The Ray sensor can do what you need - you would just fire in the -Z direction with a range of, say, 1.0 Blender Units. If there’s a collision and you press Space, the character would jump. Where are you having problems?
Thank you nickdiesel !! The force instead of serco control works pretty well, but after you jump, you can’t move while the player is on air… Can you tell me a way to solve this problem please??
:eek::eek:
All you have to do is disconnect the Ray sensor from the AND controllers that involve the keyboard movement.
They way is was set-up, is that the ground sensor has to be active in order for the box to move
Logic says: Left key + Ray sensor detecting ground = movement.
You just want: Left key = movement (meaning that it doesn’t matter if on ground or in air, it will still move)
:spin: Oh, yeah my friend but now we got the first problem again : THE CHARACTER STICKS TO THE WALL…!! If you try to jump against the wall while pressing right arrow key, you will see that…
With the solution of nickdiesel, the character didn’t sticked on the wall…
Is there a way to combine that two ways?? (the character not to stick on the wall and ability to move while jumping)… :eek::eek:
Thanx anyway for any help you give…
I tried 30 and the character still semi-sticks on the wall. It moves quite slow too… So I can’t (obviously) decrease it furthermore…
Any better solution please?