![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Curiously99 |
I’m at the start of what, it’s increasingly clear, will be a long journey. I’m trying to pass a integer from child to parent, sounds easy right?
This is on the child:
extends classMovement
class_name classActiveSprite
var axis_X_active_sprite = 2
This is on the parent:
extends Node3D
class_name classMovement
var movement_x: int
var axis_X_active_sprite
func updateAxis() → void:
movement_x = get_child(“classActiveSprite”).str(axis_X_active_sprite)
The ‘Cannot pass…’ error occurs on the last parent line. Converting it with str() doesn’t even work, and anyway it’ll need converting back to an integer for the parent to use it.
I’m not comfortable declaring the same variable on both parent and child either, but it seems to need it.
Help greatly appreciated.