Hello!
This is a question about the typing behavior and safe line casting (that little number on left side of every single line of any script in godot).
I know isn't needed and code can work anyway without that numbers becoming green, but i really feeling obsessed about it, and i always try to having all clear.
So, can someone tell me how a line like this should be formatted to having a safe line? (In Godot v4.1.1)
Thanks!
Update: I believe i found the solution by using clampf()

@onready var playerbase_spring := $playerbase_mount/playerbase_spring as SpringArm3D

func _process(_delta: float) -> void:
   (playerbase_spring as SpringArm3D).rotation.x = clamp((playerbase_spring as SpringArm3D).rotation.x, -PI/4, PI/4)

    Update solution found!
    I think this is the solution and it seems to work, if someone has something to add, happy to read.

    https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#class-globalscope-method-lerpf
    https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#class-globalscope-method-clampf

    Note: For better type safety, use lerpf(), Vector2.lerp(), Vector3.lerp(), Vector4.lerp(), Color.lerp(), Quaternion.slerp() or Basis.slerp().
    Note: For better type safety, use clampf(), clampi(), Vector2.clamp(), Vector2i.clamp(), Vector3.clamp(), Vector3i.clamp(), Vector4.clamp(), Vector4i.clamp(), or Color.clamp().
    fatalox changed the title to Lerp() and Clamp() as safe line .