Sure, Here’s the player script:
extends RigidBody3D
@export var thrust: float = 1000
@export var sideways_thrust: float = 1000
@export var jump: float = 1000
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if Input.is_action_pressed("Forward"):
apply_central_force(Vector3(0.0, 0.0, -thrust * delta))
if Input.is_action_pressed("Backward"):
apply_central_force(Vector3(0.0, 0.0, thrust * delta))
if Input.is_action_pressed("Right"):
apply_central_force(Vector3(sideways_thrust * delta, 0.0, 0.0))
if Input.is_action_pressed("Left"):
apply_central_force(Vector3(-sideways_thrust * delta, 0.0, 0.0))
#apply_central_force(basis.x * (-thrust * delta))
if Input.is_action_pressed("Jump"):
apply_central_force(Vector3(0.0, jump * delta, 0.0))
This is my player script, Im using only (apply_central_force()
and apply_torque()
).
I didn’t quite get this part of your reply
and by setting things like position and rotation directly somehow
what I’m assuming is you meant I changed the position and rotation by using the gizmos or the the values under transform properties. Correct me if I was wrong there.
And I guess I figured out the material problem. The root node of Success_Box is CSGShape_3D node, and when I make it a child of base_level whose root node is CSGShape_3D node, it inherits its Geometry properties which again makes it plain white.
When I make Success_Box a child of player(or any other node), it again gets its green colour