Hey all Taiyo here. Today I was making a Camera2D system similar to this (skip to around 5:52 ish).
This System uses a tilemap instancer similar to here.
Unlike the first link this system doesn't actually limit the camera like it's supposed to.
For those who might ask the section border doesn't have a script file.
My Camera2D does though.
Here it is:
extends Camera2D
#Declare member variables here. Examples:
export onready var leftbound = get_node("/root/boundaries/LeftBoundaries")
export onready var rightbound = get_node("/root/boundaries/RightBoundaries")
export onready var topbound = get_node("/root/boundaries/TopBoundaries")
export onready var bottombound = get_node("/root/boundaries/BottomBoundaries")
onready var player = get_node("res://Scenes/Player.tscn")
#get_node("/root/Scenes/Player")
#res://Scenes/Player.tscn
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
#_boundaries
#_boundary, left_boundary, right_boundary,bottom_boundary,top_boundary
#body.is_in_group()
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
#func _on_Area2D_body_entered(body):
print("he's in!")
if body.is_in_group("left_boundary"):
limit_left = leftbound.position.x
if body.is_in_group("right_boundary"):
limit_right = rightbound.position.x
if body.is_in_group("top_boundary"):
limit_top = topbound.position.y
if body.is_in_group("bottom_boundary"):
limit_bottom = bottombound.position.y
#if body.is_in_group("boundaries"):
#if body.is_in_group("left_boundary"):
#limit_left = leftbound.position.x
#elif body.is_in_group("right_boundary"):
#limit_right = rightbound.position.x
#elif body.is_in_group("top_boundary"):
#limit_top = topbound.position.y
#elif body.is_in_group("bottom_boundary"):
#limit_bottom = bottombound.position.y
Please help