![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | CreekWorks |
I have been working on a VR game and was trying to allow the player to pick up blocks. I looked at the documentation and found it too be very complex and was hoping to make a simpler solution. However, for the life of me I cannot figure out how to spawn in an object in 3D
Here is my code
func _on_Grab_area_entered(area):
var currentobject = null
object = area.name
var heldobject = load("res://" + object + ".tscn")
var heldobject = load("res://Box.tscn")
currentobject = heldobject.instance()
currentobject.translation = $Position3D
add_child(currentobject)
The problem happens with “currentobject.translation = $Position3D” I can’t figure out what to use instead of Translation as Position doesn’t work either. Something that might be helpful is that the object I’m trying to spawn is a Area, I had wanted it to be a Rigidbody but changed it to hopefully fix the problem.
Thanks!