Realistic vehicle tire / does BGE not support lattices?

As I’ve said before, I’m brand new to the game engine - so bear with me :slight_smile:

I have made a lattice that follows my tire mesh around, and when the tire bounces up and down it deflects nicely. When I do the same in the game engine, it seems the mesh is locked during run-time, and so the initial deflection is saved and the mesh then remains that way.

Is lattice deformation not possible in the game engine? In that case, is there some other way to get tire deflection?

This is what I would like to achieve, and of course I also want the deflection to remain on the bottom part (ground contact)

This is during run-time

You have to think in a whole different way when working with a game engine (any engine, not just blender).
You can’t do things the same way as you would for animation. You have to fake it.

In this case I’d recomend making a low poly tire and baking the normals and textures from your high poly mesh.
Next deform the low poly mesh so it’s squashed at the bottom. After that you can use UV scroll to make it look like the tire is rotating.

That’s if you want the tire to do what you’re saying. However, IMHO you’re thinking too high level, deforming tires is not something you really need to worry about in a game. It’s like adding a working zipper to a character’s pants. No-one is going to notice that kind of level of detail except you.

In this case, half the purpose is actually looking at tire deformation (as calculated by a simulation running in parallel with the blender file). Faking it is definitely a good idea, but I have no textures indicating rotation, and Im afraid the tire pattern might be to pronounced to work as a normal map. Ill definitely have a look at it though.

So, are you saying that lattice modifier wont work in BGE, or just that it’s resource heavy? Im really just interested of having a “game” with four tires in it, and nothing else.

You could use soft physics, but - it may cause some problems out there still. None of theese methods are stable in real time. Lattice won’t work in BGE.

You can use the method described by Smoking_mirror together with armature or shape key animation.

To get the desired texture you can bake your current model.

UV-animation means your move the UV-coordinates of each vertex above the texture. With a well chosen UV-grid you can perform linear motion. Unfortunately you need some Python to do exactly that.

I’m almost there now, thanks to your suggestions. Just this one last problem. Adding shape keys somehow stops the script from being able to rotate UV maps!

So, now I have baked a high-res model, and I’m using UV-mapped normal maps that I script so that they move according to the in-data (wheel rotation). Z-movement is scripted directly to the low res mesh. Unfortunately, just adding a shape key stops everything but the Z-movement. Any ideas why this might be?

With a circular symmetry on the low res model, it looks kind of OK from a distance. Here is before trying to use shape keys. I’m happy to have gotten this far!

Thank you.
Is the UV scrolling meant to work with shape keys? - because I cannot get it to work. I’m attaching Youle’s script with my added attempt of shape key, uvScroll_with_shapeKey.blend (587 KB). I tied the shape key to a driver, governed by a bone, and the bone (Z-pos) is controlled with a bge controller. The Z-position seems to change (from looking at print-outputs), but still nothing happens with the mesh.

Additionally, changing the shape key manually before starting the engine does nothing either. I suspect I am doing something wrong here.