I'm following tutorials to two different games on YouTube and I ran into this problem with both of them. One of them is the 3D Squash the Creeps tutorial and the other is a Tetris tutorial. But anytime I write the line of code that's supposed to bring up the function from another script, it doesn't work for some reason. Anyone know why? (I do spell the word "tetrimino" differently, but that's not the problem. It still works as long as your spelling's consistent.)
#Communication between scripts not seeming to work
2 messages · Page 1 of 1 (latest)
Is a mob a StaticBody3D node? Or could the player be colliding with something that is not a mob? You should check that the collider is in fact a mob. You can do this many ways. You can assign a node group to mobs and check for that. Or give the mob script a class_name like "class_name Mob" and then check if the collider is a Mob with the "is" operator ("if collision.get_collider() is Mob:").