Guest User

Player.gd Room Based Camera

a guest
Jan 12th, 2023
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. func _on_RoomDetector_area_entered(area: Area2D) -> void:
  2. # Gets collision shape and size of room
  3. var collision_shape: CollisionShape2D = area.get_node("CollisionShape2D")
  4. var size: Vector2 = collision_shape.shape.extents * 2
  5.  
  6. # Changes camera's current room and size. check camera script for more info
  7. Global.change_room(collision_shape.global_position, size)
Advertisement
Add Comment
Please, Sign In to add comment