RigiBody and rotate_object_local

MagicLordMagicLord Posts: 522Member
edited June 3 in 3D

Hi there,

A rigibody with gravity scale = 0 is rotated with this code when the player press left or right keys

var localRotationAxis = Vector3(0,1,0)
    var rotationdegree = deg2rad(moveZ*10)
    rotate_object_local(localRotationAxis,rotationdegree)   
    print('rotationdegree : ' , rotationdegree)

When there is no rotation ( rotationdegree = 0 ), the function **rotate_object_local ** continue to do a strange rotation.

https://github.com/DevMagicLord/Godot3/blob/master/bugs/rotationbug.gif

Is this because of RigiBody, or should it work as expected ?

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 626Moderator

    Are you rotating in physics_process, or process? If you are using process, it could be the problem is because the rotation is happening at the same time as a physics call, and so the two processes are competing with each other for which rotation is the correct one.

    Or it could just be a bug. One way to test this is to try rotating with another non RigidBody node and see if it gets the same results. If it does, then the bug is probably part of rotate_object_local, while if it does not, then the bug is probably RigidBody related.

  • MagicLordMagicLord Posts: 522Member

    The code is in physic_process.

    What bothers me is there is no rotation input with rotationdegree = 0, but it affects in some way linear_velocity or ship physics rotation.
    I think i will post a bug on github, Godot really need polishing.

  • TwistedTwiglegTwistedTwigleg Posts: 626Moderator
    Answer ✓

    What bothers me is there is no rotation input with rotationdegree = 0, but it affects in some way linear_velocity or ship physics rotation.
    I think i will post a bug on github, Godot really need polishing.

    Yeah, then I'd say it's probably a bug. As for Godot needing polishing, it's getting there! Godot 3 is way more polished and usable than Godot 2, especially for 3D work. I imagine in a year or two, Godot will be even more polished and usable than Godot 3.

  • MagicLordMagicLord Posts: 522Member
    edited June 3

    @TwistedTwigleg said:

    What bothers me is there is no rotation input with rotationdegree = 0, but it affects in some way linear_velocity or ship physics rotation.
    I think i will post a bug on github, Godot really need polishing.

    Yeah, then I'd say it's probably a bug. As for Godot needing polishing, it's getting there! Godot 3 is way more polished and usable than Godot 2, especially for 3D work. I imagine in a year or two, Godot will be even more polished and usable than Godot 3.

    With Godot i would be forced restrict to even more physics usage, so i could not create the original game specifications.

    Some people need a fully functional engine about the fundations, we can't loose time with something that is not ready for 3D and that needs debugging and bug fixing.

    I agree, Godot 3D it will need lot more time to get good 3D fundations and before it could pretend challenge other 3D engines.

  • MagicLordMagicLord Posts: 522Member
    edited June 10

    With camera as child of KinematicBody, there is no more rotation issues ( only capture software slowing down the game sometimes).

  • MagicLordMagicLord Posts: 522Member
    edited June 10

    Another try, without recording software, and turning around with kinematicBody, the ship started to wooble.

  • MagicLordMagicLord Posts: 522Member
    edited June 10

    Kinematic and rotation works fine.
    I had a setup to linear_velocity in init(), while this is to use with RigidBody only , so this made the Kinematic physics go weird.

    The correct way to move and rotate a RigidBody is always using forces, use linear_velocity and angular_velocity.
    Don't use object transformations on RigiBody.

Sign In or Register to comment.