Godot Version
godot 4.5
Question
hi im trying to make this psx style game and want a system were the doors teleport u to other parts of the house ive set up a script looked at tutorials but when i interact with the door it just plays the fade out animation and stays that way without me moving any ide what i have done wrong?
Where in your code do you assign the new position to player’s position property?
i use a staticbody 3d with a script that if the i interact with it should change my position based on a 3d(pos) node i placed down, and after interacting it should play a fade animation and then teleport me to the selected pos and then play a reverse fade animation, but it just plays the fade and stays in the black without me moving. Let me know if theres anything i can do and thank you for your time.
Put print statements in all relevant parts of your code to see if stuff that you’re expecting to execute is indeed executing.
Have you fixed it, or do you need more help? If you need more help, could you post the teleport code?
nope still dont know what the issue is
the script im using is a raycast to interact with a collision that triggers a transition sequence heres the following code.
raycast for interaction:
extends RayCast3D
onready var trAnim = get_tree().get_first_node_in_group(“transitionAnim”)
func _process(delta):
if is_colliding():
Global.canInteract = true
if Input.is_action_just_released(“Interact”):
if get_collider().is_in_group(“dialog”) and not Global.dialogActive and get_collider().db != null:
get_collider().db.activate()
if get_collider().is_in_group(“sceneChanger”):
Global.nextPos = get_collider().nextPos.global_position
if get_collider().mode == get_collider().a.CHANGE_ROOM:
trAnim.play(“end”)
Global.nextPos = get_collider().nextPos.global_position
elif get_collider().mode == get_collider().a.CHANGE_SCENE:
trAnim.play(“endNS”)
else:
Global.canInteract = false
the staticbody for the collision:
extends StaticBody3D
class_name TransitionActivator
enum a {CHANGE_ROOM, CHANGE_SCENE}
export var mode : a
export_file var nextScene
export var nextPos : Node3D
and the global:
extends Node
var dialogActive : bool
var canInteract : bool
var inventoryActive : bool
var nextScene : String
var nextPos : Vector3
func _process(delta):
if Input.is_action_just_released(“Esc”):
get_tree().quit()
Format your code properly using ``` tags:
```
[paste code here]
```