Hello! I have just begun to work with the blender game engine and am trying to build a simple setup for walking around in a room object. I’m not sure where this post should go so I guess it’s here
This is a very simple setup, just a box moving around a room. What I don’t understand is why my player (the box) runs through the walls (which I don’t want of course) but does not fall through the floor of my imported lightwave object. I have dynamics set on the box and the room set to static. I have imported the room object from Lightwave (.lwo) because I am fluent in lightwave and would like to create assets in lightwave and import them into the blender game engine…does imported lightwave objects/assets cause problems with the dynamics/game engine? I am using blender 2.49b…should I be using 2.56 instead?
I’ve attached my blend file…any help would be greatly appreciated, I’m very excited about blender and the game engine!
Your problem is in using dLoc. This physically changes the objects position while the sensor sends a positive pulse. Instead of using the physics engine, it will translate the cube through the wall. It doesn’t fall through, because there you are not overriding the physics. The gravity is working as normal. If you use dLoc to move -Z, you would fall through the floor.
Better would be linV: this simply tells the physics engine to move the object a certain direction at a certain vector, and the engine takes into account obstacles.
To simulate dLoc while using linV (linV tends to “slide”), simply enter the floors Material panel and select DYN where it asks you what color to choose. Then, change friction upwards, adjusting as needed. Alternately, you could use the character’s friction setting, or the move damping (though I have never gotten good results from that.)
Other objects should have no effect, as I believe they are turned into internal meshes, and the only thing you have to worry about is data loss.
Thank you for replying! I tried to add a value to LinV instead of Loc but nothing happens when I press the up arrow…I will have to read up on what these mean some more. How come when I move my box up and press “P” it stays floating…shouldn’t it fall to the floor like the other box in the scene? I seemed to be confused and perhaps I should rebuild this scene again to gain a better understanding…
You probably need to use a higher value - Blender uses Blender Units per second for linear velocity (I think), as opposed to dLoc, which runs in Blender Units per game frame (60, usually).
As for your gravity problem, make sure they are both Dynamic - the one that’s floating probably isn’t.
Ahh…I think I got it working…I’m not sure what was wrong I just deleted the objects and reset them up with linV, now I can move my little box around the screen…I’m thrilled!