Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | laterdated |
I am trying to convert a script from GDScript into C#, but I’m having a difficult time finding out what a var is referencing.
Here’s a part of the script I’m trying to convert.
onready var collision_shape = get_node("KinematicBody/CollisionShape")
...
collision_shape.shape.radius = player_radius
collision_shape.shape.height = camera_height - player_radius
collision_shape.transform.origin.y = (camera_height / 2.0)
Here’s how I am converting it.
private CollisionShape collisionShape;
...
collisionShape = (CollisionShape)GetNode("KinematicBody/CollisionShape");
...
collisionShape.shape.radius = playerRadius;
collisionShape.shape.height = cameraHeight - playerRadius;
collisionShape.transform.origin.y = (cameraHeight / 2.0f)
However I’m getting an error.
‘CollisionShape’ does not contain a definition for ‘shape’
I’m not sure what I should be converting collisionShape into. Is there anyway to see what a var type of object a var is referencing?