![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | javrocks |
extends KinematicBody2D
var cell
var tile_id
func _ready():
pass
func physicsprocess(delta):
if (collision.collider.name == “TileMap”):
cell = tilemap.worldtomap(position)
cell -= collision.normal
tileid = collision.collider.get_cellv(cell)
print(cell)
#For the if statement i get the error Invalid get index ‘collider’ (on base: ‘Nil’).
You asked this question before - that error means that “collision” is null.
exuin | 2021-04-04 22:21
so what do i do?
javrocks | 2021-04-04 22:49
Do have “collision” declared anywhere or is that all your code
exuin | 2021-04-05 02:43