Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Exoph |
Set up a new var to sense when a button is released but it keeps saying it doesn’t have a set type. The functions involved are
func _physics_process(_delta: float) -> void: var is_jump_interrupted: = Input.is_jump_interrupted("jump") and velocity.y < 0.0 var direction: = get_direction() velocity = calculate_move_velocity(velocity, direction, speed, is_jump_interrupted) velocity = move_and_slide(velocity,FLOOR_NORMAL)
func calculate_move_velocity( linear_velocity: Vector2, direction: Vector2, speed: Vector2, is_jump_interrupted: bool ) -> Vector2:
var new_velocity: = linear_velocity new_velocity.x = speed.x * direction.x new_velocity.y += gravity * get_physics_process_delta_time() if direction.y == -1.0: new_velocity.y = speed.y * direction.y if is_jump_interrupted: new_velocity.y = 0.0 return new_velocity
Which line says it doesn’t have a set type?
SteveSmith | 2022-12-07 15:24