-
Notifications
You must be signed in to change notification settings - Fork 144
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
Vector3.ZERO stops being constant and returns wrong values. #345
Comments
After some tests, I discovered some stuff: The line that ruins everythingThis is the line that makes Vector3.ZERO turns to that value:
... if I comment this line, The guessSomeone from GODOT Español (Telegram group) told me that gravity Another test: printing some constants:
As you can see, only Workaround:def _ready(self):
self.zero = Vector3(0,0,0)
def _physics_process(self, delta):
print(self.zero) In this way, it always returns (0,0,0). But I don't think this is the solution. |
I found a solution and maybe this could be a bug. By doing this: velocity = Vector3.ZERO
direction = Vector3.ZERO And then, something like: velocity.y -= fall_acceleration * delta
The solution is to do this: velocity = Vector3(0,0,0)
direction = Vector3(0,0,0) I keep this thread open because I don't know if it is a bug 🪲 or not 🤷. |
Hi @MarioMey ! Yes, However your issue is a valuable input 😃 : I'm currently re-writting the project for Godot4, and will make sure the constant are real constant (by using properties, so each time you do |
Transporting "Your first 3D game" to python, I found something weird. Simplified code:
Returns:
And this:
Returns:
If I do the same with GDScript,
Vector3.ZERO
returns always(0.0, 0.0, 0.0)
(inside_ready()
and_physics_process(delta)
).So, why it is returning wrong values?
...
The full code is here, but game is not completely transported.
The text was updated successfully, but these errors were encountered: