-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3d characters should have easier implementation. #11050
Comments
I don't know if I understand you correctly, but KinematicBody2D's move() and move_and_slide() also move the body on the global axes (i.e. without any regard for its rotation). I also found it very inconvenient to use a KinematicBody as an fps controller since move() is not easily usable (without doing rotation calculations) and translate, which does respect rotation, doesn't work well for collision detection. |
@novemberist yea the 2d one use global axis. which makes a lot of sense since top down usually uses global input (when keyboard is used) and with mouse controls you also have a global vector. But it is good to know that I'm not the only one who was bothered by the 3d physics bodies. |
If the idea is to make move() more versatile (by being able to decide between local/global axis movement), I don't think that we should make a difference between 2D and 3D though. I can also think of a couple examples where it would make sense to be able to move locally, even in 2D. Think of a game like e.g. Hotline Miami, or a top-down racing game, where movement direction is always dependent on the players rotation. btw. are you sure about not being able to rotate a RigidBody in character mode? I'm could swear this worked at some point... |
just tried yea. no rotation...
@novemberist but you are right adding a param |
KinematicBody will always be the better character controller than RigidBody. I think it makes sense to add another variant for move_and_slide() with one being for global and another for local axes, as that would help reduce the most common code by a few lines. |
I was y rotating 3d character bodies without problems in 2.x with |
@kubecz3k which charcter body? |
@HummusSamurai I dont like kinematicBody that much since it has no grvavity support out of the box. And i havent gotten good results with simple implementations like always applying down movement (in the move_and_slide function) yet... |
@toger5 rigid body in character mode |
@kubecz3k are u sure? If you can reproduce it would be great. I tried with almost all versions i could get my hands on... (not really true... But i tried with 2. And 3) and i could not rotate... |
@toger5 well all characters in my previous project were working like that, so I'm sure it's the case for 1.x and 2.x Haven't ported those to 3.x yet however but I would be very surprised if it's not working like that anymore. |
@toger5 Have you tried using move_and_slide() like in the 3D platformer demo, where gravity is passed as a second argument? I haven't had problems with that. |
oh the floor part is for gravity... I was just applying movement down. which was lagging on the ground. I think I just have to try more. But I believe you guys that kinematic body is the better option. So a move_and_slide function with a local coordiatne option would be more important I guess |
@HummusSamurai just tried the gravity for kinematic body. I can get it to work to calculate my own velocity based on a accelaration... But if I pass a second param. for p_floor_direction I don't get any gravity. would u mind making an example? |
I again did some testing and research how a 3d character is done in the demos. I'm still not satisfied with the results...
|
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine. The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker. If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance! |
Currently it is some work to make a 3d character work!
Basics:
there are two option:
Both modes don't allow for rotation on the y axis which makes them hard to use.
this would be the idea character gdscript I could imagine:
(this example is for rigid body in character mode)
that would be just great since it would be super easy to understand and super short.
the issues
Since rotate_y does not work for rigidBody (in character mode) it is much harder. (need to do math in which direction the camera looks and than modify the direction based on that...)
The issue with kinematic body is:
move_and_slide is global.. that means you have to do a vector transformation to get the vector pointing forward in global space.
I think kinematic body is the better character anyways since it allows for really simple jumping and move and slide is pretty nice too.
It seems like they were inspired by their 2d counterparts. that explains why character mode has NO rotation at all (for rigidbody)
and why move and slide uses global axis.
So for 3.0 the api for those bodies should be adapted for 3d.
what I actually propose:
option one (kinematic body):
OR
move_and_collide( Vector3 rel_vec, local=true )
move_and_slide( Vector3 linear_velocity, local=true, Vector3 floor_normal=Vector3( 0, 0, 0 ), float slope_stop_min_velocity=0.05, int max_slides=4, float floor_max_angle=0.785398 )
option two (rigidBody, in character mode)
I think even implementing both is a really good idea since I don't see a reason why there should not be the option for rotating on the y axis or why there should be no local axis move and slice
The text was updated successfully, but these errors were encountered: