Created
February 1, 2024 05:07
-
-
Save RepComm/600ac5c1a83564dd112a2d0116d12c79 to your computer and use it in GitHub Desktop.
Godot absolute force to rigidbody relative force
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var upThrust = 1; | |
var forwardThrust = 2; | |
var absoluteForce = new Vector3 ( 0, upThrust, forwardThrust ); | |
var relativeForce = absoluteForce * Basis.Transposed(); //The magic BS that makes it work | |
ApplyCentralForce( relativeForce ); | |
//I fought with ChatGPT, Bard, and google search for quite some time to get this answer. | |
//You're welcome. | |
// btw 3x3 matrices are trash, and 4x4 matrices are where its at. guess what godot uses for "Basis".... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment