Topic was automatically imported from the old Question2Answer platform.
Asked By
jGames20
I asked another question yesterday, but it was more elaborate, and no one has answered it so I decided to take a step back and ask a more general question. So, object being a node (in Godot) or a GameObject (in Unity) what is the Godot equivalent to this?
What are you trying to do?
I am trying to modify the transform y position.
What have you tried?
I have tried the following:
# The Most Current:
object.basis.y += variableName
# Another Thing I tried:
object.origin.y += variableName
# The last other thing I've tried:
object.translated(Vector3(0, variableName, 0))
I’ve never worked in 3D so I can’t personally help you, but this answer by kidscancode on another question might help you.
From that answer:
3D nodes don’t have a position property. All 3D nodes inherit from Spatial. A Spatial node has a transform (and a global_transform).
Transforms contain the position, rotation, and scale information of the body in the form of a matrix. You can access the individual components by transform.origin - the coordinates in 3D space, and transform.basis - which contains the orientation.