![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | GaryParkin |
I’m working on a simple elevator created from a flattened cube attached to a Path3D, PathFollow3D then the RigidBody3D that moves up and down.
The Path3D has points that you can move around, mine are set at 0,0,0 and 0,3,0.
The second one is 3 units higher so when the game starts it moves the RigidBody3D (elevator) up 3 units on the Y axis depending on the speed i set in the PathFollow3D’s progress.
@export_range(1, 10,.25) var totalLoopTime: float = 2
The 2 Points I connected to the outside world as:
@export_range(0, 10,.25) var pointOne: float = 0
@export_range(2, 10,.25) var pointTwo: float = 2
This all works but I’m coming from Unreal engine and they give you a movable 3D node that you can move around in 3D space to set the points (in editor time not run time).
Does Godot have anything I can set up so I can drop my elevator into the main scene and adjust the points with the mouse before running the game?
In Blender, these would be called Empties.
My whole scene:
extends Node3D
@export_range(0, 10,.25) var pointOne: float = 0
@export_range(2, 10,.25) var pointTwo: float = 2
@export_range(1, 10,.25) var totalLoopTime: float = 2
@onready var path: Path3D = $Path3D
@onready var pathFollow: PathFollow3D = $Path3D/PathFollow3D
var currentPathTime: float
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
path.curve.set_point_position(0,Vector3(0,pointOne,0))
path.curve.set_point_position(1,Vector3(0,pointTwo,0))
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
currentPathTime += delta
if pathFollow.progress <= 100:
pathFollow.progress = currentPathTime / totalLoopTime