godotengine / godot-demo-projects

Demonstration and Template Projects
https://godotengine.org
MIT License
5.65k stars 1.58k forks source link

2D Physics Tests, fixed "one-way collision script error" #962

Closed Alex2782 closed 10 months ago

Alex2782 commented 11 months ago

v4.1.1.stable.official [bd6af8e0e]

The example is very complex, I am not sure if more changes are needed. (So far I have adjusted only one line)

image

"TEST OPTIONS":

  1. "Rigid body" -> "RESULT: PASSED"
  2. "Character body -> NOT PASSED"

https://github.com/godotengine/godot-demo-projects/assets/41921395/c84b39b2-5de8-4775-9b81-be6d7f8dc872

Alex2782 commented 11 months ago

I could not find RigidDynamicBody2D in the version 3.0 documentation. I think node_name should rather be renamed to RigidBody2D.

image

aaronfranke commented 11 months ago

@Alex2782 During Godot 4's development, RigidBody2D was renamed to RigidDynamicBody2D and then renamed again back to RigidBody2D, so yes you can replace RigidDynamicBody2D with RigidBody2D.

Alex2782 commented 11 months ago

@aaronfranke The example for 'one-way collision' should be ready.

new size (Label = 120px, LabelValue = 60px) image

For comparison, the size at 0px image

tests: v4.1.1.stable.official [bd6af8e0e]

https://github.com/godotengine/godot-demo-projects/assets/41921395/f54f0e59-3b5e-4ad0-9f83-d7da88391782