G
It is technically wrong that randf() includes 1.0. If try to halve the interval, you get: one part from 0.0 (inclusive) to 0.5 (exclusive) another part from 0.5 (inclusive) to 1.0 (inclusive) Both parts have theoretically infinite numbers but the second one has one single number more than the first one. (If you include 0.5 in the first part instead, it is vice versa.) This is a general problem and not limited to halving. So why does Godot do this? Is it just implemented wrong? Or does the small…
G
Godot Version Godot 4.6 Question I’m a bit new to coding, so this might be a stupid question but… whenever I try to run the application, I get the error message E 0:00:00:451 _physics_process: Invalid operands ‘float’ and ‘Nil’ in operator ‘*’. player.gd:55 @ _physics_process() player.gd:55 @ _physics_process() even though there’s no red lines in my code, it seems to be at line 55, but the rest is baffling. This is my code: extends CharacterBody3D ## The movement speed in m/s. Default is 5.…
G
I posted Survivors Kit here when it came out, mostly about how it handles 700 enemies. This time I want to show the part I end up tweaking the most, which is what spawns and when. A stage is just a resource with a list of spawn lines. Each line says which enemy, between which times, and how many per minute, ramping from a start rate to an end rate: class_name SpawnEntry extends Resource @export var enemy: EnemyData @export var from_time: float = 0.0 @export var to_time: float = 600.0 @export…
G
Godot Version Godot 4.7.2 Question my baked lights not working 2 posts - 2 participants Read full topic
G
Hello Guys Question: Why godot game engine developers No create gdscript compiler based language instead of interpreted language? compiler based language is faster then interpreted language as simple as that 15 posts - 9 participants Read full topic
G
Hey Godot community! I’m excited to share my latest project, Block Master, a mobile block puzzle game developed using Godot Engine! I’ve been working on creating a fun, polished, and relaxing puzzle experience for Android. About the Game: Classic block puzzle gameplay Different game modes and challenges Colorful and modern interface Simple controls and engaging mechanics Designed for mobile devices Download on Google Play: play.google.com Jungle Gem: Block Puzzle Renkli mücevher bloklarını…
G
Hey everyone! I always feel awkward advertising my own content, but seeing the recent surge of people complaining about the lack of high quality Godot tutorials, I was hoping to re-surface my YouTube channel, The GameDev Tavern. It currently contains more than 70 hours of high quality tutorial content that is completely free, fully open source, uses handcrafted code / music / art (distributed under CC-0 + MIT for unlimited reuse) and leverages 25+ years of experience of software engineering…
G
Godot Version 4.7.2 Question Hello Godot forums! I have a question that probably has a very simple answer, but I’ve been having trouble parsing the adjacent posts and documentation that seem to be related. Basically, I am just trying to program the most barebones MVP of a little pinball machine, and I am interested in what the best way to achieve the physics/animation for the flippers might be. I already have logic to take input, I just need the actual “flip.” At first, I thought I would just…
G
Godot Version Godot_v4.7.2 Question Hi, I’m new to coding and Godot. I’m trying to teach myself and it’s a struggle. I want to create a cooldown for my “pet” ability using an animation in the animation player. I’ve tried a lot of different things and everything’s come up with another issue. (I’m sure there’s something fundamental I’m not understanding but I can’t figure it out and I’ve searched everywhere.) I just want to tell the game to count the pet, play the “bounce” animation, play the…
G
Godot Version Godot version 4.6.2 Question I’m following octodemy’s making projectiles hit moving targets and I’m having trouble with the cannon’s aiming the barrel of the model keeps sticking upwards and on top of that the “aim_high” if statement was just glossed over, I’m not sure if it’s because the player character is the cannon target or if I missed something . If you share code, please wrap it inside three backticks or replace the code in the next block: extends Node3D class_name…
G
Godot Version 4.2.2 Question I am building a 3-dimensional chess game. Every field is a StaticBody3D with a CollisionShape3D, with a MeshInstance3D child node containing the chess piece (Blender import). I tried moving the piece using the reparent function on the MeshInstance3D, moving it to another StaticBody3D field. But this does not make the piece jump to the new parent field, it just moves the piece in the node tree, not in the scene. I do not need to animate the movement of the pieces at…
G
Godot Version 4.4 Question How in the heck do I alter things between scripts in gdscript? I have wasted an entire day just trying to do this. I have a script that manages interactable objects and a player script. Although the syntax in other languages is usually some equivalent of import my_example_script, I can’t find the syntax or any working step-around. So, I’ve finally created an account just to ask this because on my life, I cannot figure it out. Any help would be greatly appreciated. 6…
G
Godot Version 4.6.3 Question My pathfinding code just makes my enemy flip on it’s side and not do anything. here’s my code func PathfindToNode(TargetNode: Node3D): NavAgent.set_target_position(TargetNode.global_position) var NextSpot = NavAgent.get_next_path_position() look_at(NextSpot, Vector3.UP) velocity = transform.basis.z 9 posts - 5 participants Read full topic
G
Godot Version 4.7.2 Question I find using ticks to be more comfortable than a float to measure time, but is there something about using Time.get_ticks_msec() that is worse than just delta? Like as an example precision, is delta more precise than ticks? 3 posts - 2 participants Read full topic
G
Godot Version 4.7.2 Question I made a Brick scene that has a Sprite2D, with GradientTexture2D texture, and CollisionSprite2D, with Rectangle2D shape. I made a Wall scene with wall.gd script and no children. The script generates instances of loaded Brick as its children. Brick (Area2D): Sprite2D CollisionSprite2D Wall (Node2D) I want to make every column of bricks have different color. How do I achieve this? I tried accessing Sprite2D of the Brick instance, but it was not of Sprite2D type.…
G
Godot Version v4.7.2 Context Hello. New to Godot/game development. I want to randomly spawn enemies that are listed and preloaded separately. Right now, I am preloading the enemies in an autoloaded ‘Library’: #library.gd const APPLE = preload("res://scenes/apple.tscn") var food = ["APPLE"] The battle script chooses and spawns them: #battle.gd @onready var lib = $/root/Library var options func _ready(): options = lib.food spawn_enemies() func spawn_enemies(): var pick = options.pick_random() var…
G
Godot Version 4.7.2 Stable Question My scene structure is like so: Main (Node) UserInterface (CanvasLayer) HUD (Control) Game (Node3D) Level (Node3D) Player (CharacterBody3D) I believe the correct way to transmit the player data to the HUD to update is by emitting signals from the player which the HUD will listen to. I’m just not sure what the best way is to initially connect to those signals, for example, if the player is removed from the scene tree and then re-added again at runtime how would…
G
Godot Version Godot_v4.7.2 Question Hi! I’m a beginner to coding and Godot. I’m trying to make a game where you pet my mom’s cat for her. I’m trying to code a cooldown for petting (which is performed in the _on_body_exited function) but for some reason my timer either isn’t starting or isn’t timing out. This is probably a simple fix I just can’t seem to find it haha The petting is counted in a different node from the cooldown for clarity’s sake and so I can add cooldown reduction upgrades…
G
Godot Version 4.6 Question I’m developing a 2D side-scrolling auto-runner game in Godot 4.6. I want to introduce uphill, downhill, and flat track sections. My idea is: * Uphill: the player’s cart gradually slows down. * Downhill: the cart gradually increases its speed. * Flat: the cart maintains its regular speed. I’m trying to understand the correct architecture before I start creating the track artwork, platforms, collision shapes, and scenes. Should I handle the slope detection and speed…
G
Godot Version 4.7.2 Question Hi, this is a sort of follow-up to my last post here I was able to set a destination scene and walk through the door, but when I return to the original scene and try to interact with the door again, the destination scene returns to a null value and gives this error: E 0:00:13:138 ShipLevelTransition._player_entered: Invalid type in function 'load_new_level' in base 'Node (global_level_manager.gd)'. Cannot convert argument 1 from Nil to String. <GDScript…
G
Godot Version 4.6.1 Question I want to make an object move in front of my character (as a placeholder for an attack hitbox), but I keep getting error when I’m trying to do this: func _physics_process(_delta): if Input.get_vector() = “left”: print_debug(“left”) or this: func _physics_process(_delta): if input_direction = “left”: print_debug(“left”) I’m trying to get this based from: func get_input(): var input_direction = Input.get_vector(“left”, “right”, “up”, “down”) And I’m getting this error…
G
(topic deleted by author) 1 post - 1 participant Read full topic
G
VSCode extension coming soon! https://github.com/its99studios/gdc GDC is a language and runtime made for handling dialogue in Godot. It has syntax similar to GDScript and integrates perfectly into Godot. This is the first plugin I have ever made, and the main purpose is to provide dialogue management the way I want to. Features GDScript-like Syntax The syntax is somewhat similar to GDScript; it is very human-friendly. character ExampleGuy # 1 GDC file can contain multiple conversations for a…
G
Godot Version 4.7.2 Question The issue started when I pressed F12 when the game was stopped because of error. The game then progressed into another one at which point I stopped it and started fixing my code. I have not renamed any files, edited or deleted files manually. I got rid of the error momentarily by doing project > reload current project. Now what happens is that when I try to run my game I get an unrelated error concerning code that used to run and hasnät been touched in ages. If I…
G
Godot Version 4.7.2 Stable Question I have made a first person player with an “InteractRayCast” component which can detect collisions. I have an idea to create an “InteractComponent” scene which I can add to other scenes and adjust settings to handle: NPCs - “Talk” Doors - “Open” Objects - “Pick Up” The component would have a generic interact() function which could be extended for each scenario. I’m just not sure what the right way is to access the InteractComponent from my InteractRayCast…
G
Godot Version 4.7 Question I have a character with multiple forms for a game (a small version, a regular version, one with a sword etc) that all have their own animations for basic movement like idle and walk and I’d like to switch between them. The entire thing is controlled via an AnimationTree. At the moment I have multiple StateMachines but I think doing one StateMachine and then switching the animations via animation libraries would be doable. However, when I try that godot gives me a…
G
Godot Version 4.6.3 Question Hi, I need some advice on how to change this menu I got from a tutorial into one that stays 2D but uses 3D objects in sub viewports, I also want the selected object to be able to be rotated with the mouse but that’s an extra thing. i have screenshots of the current layout along with the code extends Control @export var radius_x: float = 420.0 @export var radius_y: float = 120.0 @export var center_offset: Vector2 = Vector2(0, 0) @export var front_scale: float = 1.35…
G
Hi everyone! I’d like to share Godot Mini Game, an open-source, MIT-licensed plugin for exporting Godot projects to WeChat and Douyin Mini Games, with TikTok Mini Game Native in beta. The goal is to make these platforms accessible from the Godot editor, including both export tooling and a shared GDScript SDK. What it does Adds a Mini Game Export dock: choose the platform, enter your App ID (or TikTok Client Key), select a Web preset, and export a folder for the platform’s development tools.…
G
Godot Version 4.7.2.stable Question I think the title is rather self-explanatory, I just want to know if this is possible or not. The error I am receiving is this: “Expected “)” after parameter name” If anybody can help, I would be most appreciative. 2 posts - 2 participants Read full topic
G
Hello everyone! I’d like to share a project I’ve be en developing with Godot Engine: Shardana, an open-world survival horror set in ancient Nuragic Sardinia. I’m an independent developer, and this project started as an experiment that gradually evolved into a much larger game. One of my main goals has been to push Godot’s capabilities for 3D environments, environmental systems and multiplayer gameplay. Rather than using a traditional level-based structure, Shardana features an open world…