Último tema hace 5 d

Godot Forum

forum.godotengine.org

Foro Discourse en inglés. 9 secciones seguidas: General, Help, Physics, Programming, Shaders, UI, Assets, Games y Applications.

Discusiones por día
29
Discusiones recopiladas
271
Mensajes por día
65
Secciones
9
Fuentes seguidas
11
Motor
Discourse

Últimas discusiones

Recogido cada 4 horas desde el feed público del foro. Solo se reproducen el título, el enlace y el principio del mensaje; cada enlace remite a la fuente.

Godot Shader Pack

1.2.5 (2026-09-02): Added spiral_galaxy (scene and shader). Added refraction_tunnel (scene and shader).

why do i get"Invalid operands 'Vector2' and 'Nil' in operator '*'." on one scene but if i recreate the scene exactly i dont get it in the new, identical one?

Godot Version 4.7.2 Question exactly as the title: why do I get this error, "Invalid operands 'Vector2' and 'Nil' in operator '\*'." in one scene but not in the EXACT duplicate of it? I am following the godot documents tutorial" “Your first 2d game” to re familiarize myself with programming. My code was working perfectly fine until i decided i wanted to add a way to slow down the players movement when you hit shift, and return it to the default value when released. as soon as I added this i began getting the error “Invalid operands ‘Vector2’ and ‘Nil’ in operator ‘*’.” at this function: if velocity.length() > 0: velocity = velocity.normalized() * speed $AnimatedSprite2D.play() else: $AnimatedSprite2D.stop() specifically at the line: velocity = velcotiy.normalized() * speed I thought maybe it was the new code i added, which boiled down to adding a variable called “speed_old” that recorded the contents of “speed” and these lines of code: if Input.is_action_just_pressed(“slow”): speed *= .5 print(speed) #this was just so i could make sure it was changing speed if Input.is_action_just_released(“slow”): speed = speed_old so i commented out the code, then the code and “speed_old” variable, and then finally decided to copy and paste the exact code from the tutorial into my script so i knew for a fact that it was “correct” and no matter what I still kept (and keep getting) the error. essentially it went from working to not for no obvious (to me) reason the odd thing is that i made an

why do i get"Invalid operands 'Vector2' and 'Nil' in operator '*'." on one scene but if i recreate the scene exactly i dont get it in the new, identical one?

Godot Version 4.7.2 Question exactly as the title: why do I get this error, "Invalid operands 'Vector2' and 'Nil' in operator '\*'." in one scene but not in the EXACT duplicate of it? I am following the godot documents tutorial" “Your first 2d game” to re familiarize myself with programming. My code was working perfectly fine until i decided i wanted to add a way to slow down the players movement when you hit shift, and return it to the default value when released. as soon as I added this i began getting the error “Invalid operands ‘Vector2’ and ‘Nil’ in operator ‘*’.” at this function: if velocity.length() > 0: velocity = velocity.normalized() * speed $AnimatedSprite2D.play() else: $AnimatedSprite2D.stop() specifically at the line: velocity = velcotiy.normalized() * speed I thought maybe it was the new code i added, which boiled down to adding a variable called “speed_old” that recorded the contents of “speed” and these lines of code: if Input.is_action_just_pressed(“slow”): speed *= .5 print(speed) #this was just so i could make sure it was changing speed if Input.is_action_just_released(“slow”): speed = speed_old so i commented out the code, then the code and “speed_old” variable, and then finally decided to copy and paste the exact code from the tutorial into my script so i knew for a fact that it was “correct” and no matter what I still kept (and keep getting) the error. essentially it went from working to not for no obvious (to me) reason the odd thing is that i made an

0xFlash: A simple math game created using C++ and GDextension

GitHub page Itch.io page (with compiled versions for Windows and Linux) I really enjoyed putting together a 3D GDextension/C++ tutorial earlier this year, but I also wanted to gain more practice with 2D design. Therefore, I created a very simple math game that lets you practice (1) converting from hexadecimal to decimal and back and (2) multiplying two numbers. This game, like the 3D tutorial, was coded entirely in C++ using GDExtension–not because I think it will perform better in that language, but just because I wanted to get more experience with C++. The game also lets you save results to a local .csv file, thus allowing you to see how your speed improves over time. At some point, I plan to create a separate Python script that will allow you to analyze and visualize your progress for each game mode. The game is released under the MIT license, so you’re welcome to use the code and editor file for your own projects. I also did not use any generative AI tools to create this game. I definitely don’t consider this game to be an exemplar of UI design or C++ code! However, given how few C++/GDExtension projects are available online, I thought it would be helpful to share it as a reference. (It doesn’t currently have step-by-step instructions, unlike the 3D GDextension/C++ tutorial or this C++ version of Godot’s Your First 2D Game , so those projects might have a bit more educational value.

0xFlash: A simple math game created using C++ and GDextension

GitHub page Itch.io page (with compiled versions for Windows and Linux) I really enjoyed putting together a 3D GDextension/C++ tutorial earlier this year, but I also wanted to gain more practice with 2D design. Therefore, I created a very simple math game that lets you practice (1) converting from hexadecimal to decimal and back and (2) multiplying two numbers. This game, like the 3D tutorial, was coded entirely in C++ using GDExtension–not because I think it will perform better in that language, but just because I wanted to get more experience with C++. The game also lets you save results to a local .csv file, thus allowing you to see how your speed improves over time. At some point, I plan to create a separate Python script that will allow you to analyze and visualize your progress for each game mode. The game is released under the MIT license, so you’re welcome to use the code and editor file for your own projects. I also did not use any generative AI tools to create this game. I definitely don’t consider this game to be an exemplar of UI design or C++ code! However, given how few C++/GDExtension projects are available online, I thought it would be helpful to share it as a reference. (It doesn’t currently have step-by-step instructions, unlike the 3D GDextension/C++ tutorial or this C++ version of Godot’s Your First 2D Game , so those projects might have a bit more educational value. 1 post - 1 participant Read full topic

271 discusiones recopiladas desde el 2 de septiembre de 2026. Seguir este foro por palabra clave →