Getting error Invalid callv target #2

I'm using Dnd and I'm trying to move the player using the move outside all function but when the player collides with the wall I get the error Invalid callv target #2. Does anyone know what that means?
 

chamaeleon

Member
Probably should include a screenshot of your D&D blocks involved. What block is trying to execute the move_outside_all() function? Which instance is the target of the code block? Which object is the code block added to? In any case, given an obj_wall instance and an obj_player instance, with obj_player having a collision event for obj_wall instances, and a single Execute Code block in it with the line move_outside_all(0, 100); moves the obj_player instance to the right so it does not touch the wall, without any error for me.
 

Aviox

Member
I realize this post is old, but posting here for posterity.

The Invalid callv target #2 error refers specifically to trying to "call" something that isn't a function or method. e.g.

GML:
myfunction = noone;
myfunction();
this would error on the second line, because myfunction isn't callable. you can use the function is_callable() to check if needed, but most likely it is from a typo or accidentally re-using a variable name, etc.
 
Top