Download common/scripts/area.gd from NeatoGames/saddle-up: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/datasets/NeatoGames/saddle-up/resolve/main/common/scripts/area.gd
- Command line
-
hf download hf://datasets/NeatoGames/saddle-up/common/scripts/area.gd
-
curl -L -o area.gd https://huggingface.co/datasets/NeatoGames/saddle-up/resolve/main/common/scripts/area.gd
523 Bytes
| extends Node | |
| func get_random_position(position): | |
| #just to get a random point in the world | |
| var enemy_position: Vector3 = Vector3(randf_range(-10, 10), randf_range(-10, 10), randf_range(-10, 10)) | |
| #random number; defines how far from the player your enemy will spawn | |
| var enemy_distance = randf_range(1, 10) | |
| enemy_position = enemy_position.normalized() | |
| #muliplies the random vector from the start with your radius | |
| enemy_position.x *= enemy_distance | |
| enemy_position.z *= enemy_distance | |
| return position + enemy_position | |