As the title said, the built-in animation player on my tilemap node doesn’t pause when I pause the Scene Tree. The animation component of the tilemap doesn’t seem to be affected by the process mode at all, for instance if I set the process mode to disable, the animation will still play. Any idea why this is happening/how to fix it?
I pause via get_tree().paused = true which is triggered through an autoload pause menu.
To awnser your other question, I do mean the animated tile feature. (As in I go to Tileset>“My Tilemap Name”>Select>Animation, and then configure the animation there.)
That just completely pauses the entire game, I can’t interact with the menu or anything because of the changed time scale. I checked online and it doesn’t seem like there’s any way to disable time scale alteration for specific nodes, so I think this solution is off the table for the time being.
Also it doesn’t deactivate the player, so they can still do like crouching animations and flip horizontally.
That just completely pauses the entire game, I can’t interact with the menu or anything because of the changed time scale. I checked online and it doesn’t seem like there’s any way to disable time scale alteration for specific nodes, so I think this solution is off the table for the time being.
You need to create a STATEMACHINE in the game to which you subordinate everything and have full control over everything. This is the best way to control events in the game, in the project, etc. The STATEMACHINE then listens to all the created entities you need.
Of course it depends on how conceptually you have designed your project. This is important. At an advanced stage of the project, it is quite difficult to apply STATEMACHINE.
STATEMACHINE talks about the state your game is in. IsGame, IsMainMenu, IsPaused etc.
And to that you subordinate everything you need to make it work in that mode.
Right, I understand that. I assume what you’re proposing is that I would pause the animation via code in the tile map script when the game paused state is on. Problem being that I can’t seem to find a way to pause the tile map animation via code or even in the editor.
Hello! I’m new to the community, but I’ve used Godot for a year now. I seem to have found a workaround to this and I just wanna share it. I’m using Godot 4.4 but this seems to work for Godot 3.1+. I first created a script for a custom tileset class like so:
extends TileSet
class_name CustomTileSet
const PAUSED_SPEED := 0.00000001
const NORMAL_SPEED := 10.0
func set_animation_paused(paused: bool, atlas_source_id: int) -> void:
var source := get_source(atlas_source_id)
if source is TileSetAtlasSource:
var atlas := source as TileSetAtlasSource
var frame_speed := PAUSED_SPEED if paused else NORMAL_SPEED
for i in atlas.get_tiles_count():
var coords := atlas.get_tile_id(i)
if atlas.get_tile_animation_frames_count(coords) > 1:
atlas.set_tile_animation_speed(coords, frame_speed)
else:
push_error("Source ID %d is not a TileSetAtlasSource." % atlas_source_id)
The PAUSED_SPEED is not set exactly to zero because the set_tile_animation_speed does not allow for 0 speed. Save the script and create a new resource file, with the resource type as your custom tile set type.