Skip to content

Kamera und Zoom

SamToorchi edited this page Feb 10, 2020 · 1 revision

Struktur

  • Camera2D
    • Area2D
      • CollisionShape2D (80,64)
  1. Die Kameraposition ändern: Area2D --> Transform --> Position (80,80)
  2. Die Kameraszene in der Hauptszene einbetten
  3. Kameraeinstellungen --> Current aktivieren
  4. Anchor mode --> Drag Center

Skript

extends Camera2D


func _process(delta):
	var pos = get_node("../player").global_position
	var x = floor(pos.x) - 16
	var y = floor(pos.y) - 16
	global_position =  lerp(global_position, Vector2(x,y), 0.1)
Clone this wiki locally