Sorry if this is supposed to be in the support forum I couldn’t decide where to post it.
I’m working on a little game that may be expanded when I learn more but I’m not
thinking of making it really great. I’ll see how well it goes. Now my question i have a little
test maze and a monkeyhead as a character. I got the monkey moving but offcourse it’s
still going through the walls so, I have been messing around with a collision sensor block
but I can’t get it to work and I can’t find a tut about it anywhere. So could someone
explain to me how I can keep the monkey from going throug the walls or link to a tut or
something?
Can’t you use a collision logic block or something and then when you for instance are going forward and collide with the wall, your movement along the axes is 0?
What you’ll need is ‘ray’ sensors. Create 4 of them on your monkey, one for each X and Y axises, and adjust the distance according to your monkey’s size. Make sure the ‘pulse mode’ button is pressed on each one (top left button…three dots at the bottom). Now, when the “forward” (probably +Y axis, check to make sure what your axises are) ray sensor is positive, set a ‘motion’ actuator with exactly the opposite force that your character moves forward with.
So: press forward key -> monkey moves forward -> ray detects wall -> applies a negative force counterbalancing the positive force
Do the same for each direction. If you need me to, I could probably rig up an example. Good luck!
Many thanks Stu that sounds like just what i need.
But my character (monkeyhead for now) only moves forward and backward and i turns aroud it’s z axis so do i still need the rays at the sides?
And could you perhaps make a little example?