bma Posted January 14, 2013 Report Share Posted January 14, 2013 Hi. Does anybody know how to use "GetClosestObjectInRange"? I have a civil person which i want to fight with civil people around him and im trying to use "GetClosestObjectInRange" to find the closest. But i keep on getting the error: "Can't call Person::Person((classGameObject)1231635496) in current scope"Can anybody tell me what i do wrong or maybe how to fix the problem?object FistFight : CommandScript{ FistFight() { } bool CheckPossible(GameObject *Caller) { return true; } bool CheckTarget(GameObject *Caller, Actor *Target, int ChildID) { return true; } void PushActions(GameObject *Caller, Actor *Target, int ChildID) { if(ChildID == 1) { Person p(Caller); Person p2 = p.GetClosestObjectInRange(20.0f, ACTOR_PERSON); { p.PushActionmove(ACTION_NEWLIST, &p2, TARGET_FOLLOW); p.PushActionTurnTo(ACTION_APPEND, &p2); p2.PushActionTurnTo(ACTION_NEWLIST, &p); p.PushActionFistFight(ACTION_APPEND, &p2, true); } } }}; Quote Link to comment Share on other sites More sharing options...