add new scene, bees, beehive picking, suit picking wip
This commit is contained in:
22
scripts/bee.gd
Normal file
22
scripts/bee.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
class_name Bee
|
||||
extends Node3D
|
||||
|
||||
@export var speed: float = 1
|
||||
|
||||
var swarm: BeeSwarm
|
||||
var move_to_position: Vector3
|
||||
|
||||
func _ready() -> void:
|
||||
_pick_random_position()
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_move(delta)
|
||||
|
||||
func _pick_random_position() -> void:
|
||||
move_to_position = swarm.position + swarm.get_random_point()
|
||||
|
||||
func _move(delta: float) -> void:
|
||||
global_transform.origin = global_transform.origin.lerp(move_to_position, speed * delta)
|
||||
look_at(move_to_position, Vector3.UP, true)
|
||||
if global_transform.origin.distance_to(move_to_position) < 0.1:
|
||||
_pick_random_position()
|
||||
Reference in New Issue
Block a user