Godot Version
4.2
Question
Hi guys,
I’m working on a platformer where the player can only move along predefined paths.
In order to easily build my levels, I created a library of “tiles” made of one mesh (for visual purpose only) and its corresponding Path3D.
I coded a script that keeps track on which tile is active and moves the player along it using sample_baked_with_rotation() that looks like this in pseudocode:
current_tile.get_next_position(player, velocity)
if (current_tile.has_reached_end_of_path):
current_tile = get_adjacent_tile(current_tile)
It’s all working great, and as a next step, I was considering doing the folllowing:
- sample the current tile with a low bake_interval value for extra precision
- clear the _baked_cache of the tile as soon as the player has moved away from it
My questions are:
- Do you think it’s worth it to clear the baked_cache or Godot does it automatically?
- If I do need to clear it, how should I do it since the _baked_cache property isn’t exposed?
Thanks for the help!