godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.17k stars 21.2k forks source link

Jitter when import blend file as Vehicle #77298

Open CsloudX opened 1 year ago

CsloudX commented 1 year ago

Godot version

v4.1.dev2.official [668cf3c66]

System information

window10 64bit

Issue description

When I import a blend file as a Vehicle, it jitter. GIF 2023-5-21 9-43-53

Steps to reproduce

Pleanse run the reproduction project (Need blender)

Minimal reproduction project

VehicleTest.zip

AThousandShips commented 1 year ago

Please provide some more information on the imported model, what kind of collisions are you using? This seems likely to be an issue of trimesh colliders which are known to cause issues in physics, just a screenshot with the collision shapes would be helpful

CsloudX commented 1 year ago

The Scene only two collision: The groud and the Vechile, 2 of them was build-in BoxShape collision. ADD: The groud I tested Use BoxShape and create Trimesh Collision by CubeMesh, all will be jitter. image

Calinou commented 1 year ago

Double-check that your vehicle's body collision shape is not too low, which would cause it to sink within the ground when the wheels come in contact with the ground. Also double-check the suspension values to make sure they're appropriate (the defaults aren't ideal). Check the Truck Town demo for an example of a working setup.

The ZIP included in OP is not a complete MRP, as I cannot open it despite having Blender 3.5 configured in the Editor Settings:

Cannot open file 'res://Test.tscn'.
  Failed loading resource: res://Test.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_data.cpp:574 - Index p_idx = 1 is out of bounds (edited_scene.size() = 1).
  res://StoreRoom/ExcavatorSimulator/Test2.tscn::GDScript_jtpsn:5 - Parse Error: Identifier "XGlobal" not declared in the current scope.
  Cannot open file 'res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn'.
  Failed loading resource: res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.blend. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  scene/resources/resource_format_text.cpp:621 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  Cannot open file 'res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn'.
  Failed loading resource: res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.blend. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  scene/resources/resource_format_text.cpp:621 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  Cannot open file 'res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn'.
  Failed loading resource: res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.blend. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  scene/resources/resource_format_text.cpp:621 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/ExcavatorSimulator.tscn:62 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn
  Cannot open file 'res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn'.
  Failed loading resource: res://.godot/imported/Excavator3.blend-5c02441e5356daf43e6d95ebadd7474d.scn. Make sure resources have been imported by opening the project in the editor at least once.
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.blend. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  scene/resources/resource_format_text.cpp:621 - res://StoreRoom/ExcavatorSimulator/Excavator3.tscn:8 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.blend
  Failed loading resource: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:174 - res://StoreRoom/ExcavatorSimulator/ExcavatorSimulator.tscn:62 - Parse Error: [ext_resource] referenced non-loaded resource at: res://StoreRoom/ExcavatorSimulator/Excavator3.tscn
CsloudX commented 1 year ago

@Calinou The test.tscn was only a test scene, it not important. And the version of blender I used was 3.3, I don't know why 3.5 can't open Excavator.blend, myabe I will test it later. The Vehicle's mass center I was set to Vector3(0,0,0) image And all Wheel's setting I only changed the stiffness to 20: image

This settings I was test a new scene that not import from blend file, it work well.

CsloudX commented 1 year ago

I'm try open Excavator.blend file with Blender3.5.1, it's OK. image

CsloudX commented 1 year ago

Hi, my friends, I'm clean up the reproduction project, wish it can help for this issue. VehicleTest.zip

CsloudX commented 1 year ago

Hi, my friends, I'm test again, and found this issue maybe was cause by CollisionShape's size.

https://github.com/godotengine/godot/assets/35988767/6bd6f7ff-bbb7-4524-9a07-b4da577f935b

Look the video, if set the CollisionShape's size to (2.428, 1.059, 3.571), the vehicle not jitter, if set to (2, 0.5, 2), it jitter.

ADD: For the reproduction project, I can't found a valid value which not jitter, so I'm upload my new test project.

VehicleTest.zip