0 votes

I have a simple player FPS controller set up like so:


The neck bone is rotated up and down which in turn makes the camera rotate up and down (for y axis camera movement)
The player moves using integrateforces.
A rigidbody (in this instance, of course, a gun) is created as the child of the root node and set to kinematic mode, its position and rotation are updated inside the player integrateforces function.
When the player is translating, the gun sticks to the point it is set to, as expected. When the player/camera is rotating, the gun jitters around and seems to go further then it should (gif provided)
image 1
Some other (unanswered) questions I had a while ago have similar issues, that being the same general premise: any physics body does not like its position/rotation being set by the player for whatever reason. This forum does not allow embedding mp4s, so I will just link the two videos.
In the first video, the camera has a child rigidbody set to static mode (the sphere wireframe in the middle of the screen) and a 6dofjoint as a child of the rigidbody - the gun is then a child of the root node and set to one of the joint's connected nodes. The gun "lags" behind where it should be this is not caused by the joint as you can see in the second video. (I enabled all of the axis locks)
In the second video, the scene is exactly the same, except the joint is connected directly to the player rigidbody, and not a child of the camera.

Why does this happen and how can I make it not happen? (eg the gun stays locked to the point in front of the camera - preferably with a joint for some custom axis locks etc.)

in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.