Comments (4)
Okay, it seems to be setting is_step
true during the stair down part, I'll see if I can figure out why.
from godotstairs.
It's this part:
if not is_step and is_on_floor():
var test_motion_result: PhysicsTestMotionResult3D = PhysicsTestMotionResult3D.new()
var step_height: Vector3 = STEP_HEIGHT_DEFAULT
var transform3d: Transform3D = global_transform
var motion: Vector3 = velocity * delta
var is_player_collided: bool = PhysicsServer3D.body_test_motion(self.get_rid(), params(transform3d, motion), test_motion_result)
if not is_player_collided:
transform3d.origin += motion
motion = -step_height
is_player_collided = PhysicsServer3D.body_test_motion(self.get_rid(), params(transform3d, motion), test_motion_result)
if is_player_collided:
if test_motion_result.get_collision_count() > 0 and test_motion_result.get_collision_normal(0).angle_to(Vector3.UP) <= deg_to_rad(STEP_MAX_SLOPE_DEGREE):
head_offset = test_motion_result.get_travel()
is_step = true
global_transform.origin += test_motion_result.get_travel()
Specifically:
if not is_player_collided:
transform3d.origin += motion
motion = -step_height
is_player_collided = PhysicsServer3D.body_test_motion(self.get_rid(), params(transform3d, motion), test_motion_result)
It's triggering as true for some reason.
from godotstairs.
Godot 3.x:
var is_player_collided: bool = PhysicsServer.body_test_motion(self.get_rid(), transform3d, motion, false, test_motion_result)
returns true (correct answer).
Godot 4.0:
var is_player_collided: bool = PhysicsServer3D.body_test_motion(self.get_rid(), params(transform3d, motion), test_motion_result)
returns false (incorrect answer).
from godotstairs.
Okay, so setting this seems to do it:
params.recovery_as_collision = true
No idea if this is good or not, but I'll set it for now to keep parity with the original.
from godotstairs.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godotstairs.