Modify collision bounds in-game.

I’ve been using blender for about 2-3 years now, and I’ve decided I’d give the game engine a try, so I’m a bit of a noob as far as python scripting and logic gates go.

I’m trying to adjust the character’s collision bounds when the ray sensor detects a certain object. I used the “Edit Object” actuator and set it to a Plane object. I’ve tested this in a quick test scene, and it works on static objects. But for some reason it doesn’t work on character objects. These are my physics settings

If anybody knows a way around this, I’d appreciate a response.

Thanks in advance :).

Well, it’s not an armature, it’s parented to a physics object.

But thanks! I’ll be sure to read this. Hopefully it helps :slight_smile:

I can’t tell on the Character Type physics. I never used that.

Well basically I just want my character to be able to jump up through the platform, but fall down and land on it as if it were solid.

I don’t what the standard solution for this is, but I was assuming that by replacing the mesh you could have control over material physics. But to no avail. Maybe I’m doing something wrong.


Player_jump_through_platform.blend (86.4 KB)

The player needs to be able to jump through so the platforms can’t be solid. I wouldn’t play with changing solid/ghost types in-game if that’s even possible.

Rather I would make it so that platforms are static ghosts and player rayCasts down from the bottom lelft and right corner of his physbox and detects the platform via property match. If there’s a result from either rayCast apply upwards force equal to your gravity.

The only way I know of to make Static objects Ghost, is to Ghost parent them to an object. To change back to solid, you have to do the same thing but without the Ghost option enabled (both Python setParent() and Parent Actuator).

But could anyone confirm if material physics are not changeable during the game?

Like I said, the Edit Object: Replace Mesh actuator works on all static objects, so it’s basically a ghost toggle if you use it correctly, but I want it to work on Character or Dynamic objects as it would be more universal and make level design easier.

I think dynamic objects’ physics are only updated on replace mesh if the type is set to triangle mesh.

Tried that, but no. Using Triangle Mesh for Dynamic objects is no option anyway.

Jump_Through_Platform.blend (462 KB) Well, for now, this is the best I can do. It’s not difficult, but it’s time consuming when you have to do this to every single platform in the scene.

The file is made for 2.71.

You can use KX_GameObject.reinstancePhysicsMesh()
…But I wouldn’t recommend that because it decreases drastically the frame-rate.

i think replaceMesh is your best option.