Useful Scripts
This is a collection of scripts which were collected to address reoccurring needs of my students. They aim to be rather simple and are often full with comments, so you can look at the scripts if you're curious. They hope to give insight in how you can write your own scripts once you feel comfortable doing that :)
They are categorized in these folders:
- assets
- editor
- examples
- interaction
- movement
- player
- script_utilities
assets
These are assets that are used by the script. Feel free to replace them.
editor
Editor scripts need the plugin to be activated in Project/Project Settings/Plugins.
Make sure the checkbox Enabled next to usefulScripts is checked.
originToChildren
Align the origin of a group to the average of the children.
examples
Various example scenes, how the scripts can be applied.
interaction
animation_path
Control an AnimationPlayer depending on the position of a player (or another given object) along a Path3D.
hideshow
Hide or show elements depending on the distance to a player (or another given object).
scene_change
Replace the scene with another given scene depending on the distance to a player (or another given object).
teleport
Teleport a player from a source location to a target location, depending on the distance to the source location.
movement
Make objects move.
floating
Imitate a floating movement, by moving objects periodically on various axes.
lookAtMe
Follow other objects by directing a specific axis to them, just like you would turn your head to face something you look at.
rotation
Rotate objects periodically.
transformator
Combine floating and rotation in a single script, so you can attach it to a single object. There are various options for different movements.
player
freecam_firstperson
A player script for a free flying player.
freecam_thirdperson
A player script for a free flying player, with the player in view.
player_firstperson
A player script for a walking player. A classic FPS. Note that you need objects to walk on for this to work. These objects need to have collisions.
player_thirdperson
A player script for a walking player, with the player in view. Note that you need objects to walk on for this to work. These objects need to have collisions.
script_utilities
Some functions are used repeatedly throughout the script. These are put into the script_utilities to keep the code more readable and easier to maintain.
Changelog for version v0.0.8
2026-11-05 20:18:52
No changelog provided for this version.