Post by damion on Dec 9, 2020 13:35:08 GMT
Hello,
so I'm rather a complete newcomer to Unity and not really an experienced programmer (learning by doing, but so far I've only done websites and database connections... )
So now I wanted to realise the following: A base in the middle, surrounded by fences/walls and towers. On the towers are fighters from the player, who kill incoming zombies and gain experience.
So far so good, but there are some things I can't find out:
1st problem ) How can the zombies attack the fences/walls/towers? I put layer and tag "Defence" on them and told the zombies to find and attack them ( FSM ). They do find them, but they do not attack them. Instead of this I get:
NullReferenceException: Object reference not set to an instance of an object
Invector.vCharacterController.AI.vControlAIMelee.Attack (System.Boolean strongAttack, System.Int32 _newAttackID, System.Boolean forceCanAttack) (at Assets/Invector-AIController/Scripts/AI/AI Controllers/vControlAIMelee.cs:94)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.EngageTarget (Invector.vCharacterController.AI.vIControlAICombat controller) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:86)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.OnUpdateCombat (Invector.vCharacterController.AI.vIControlAICombat controller) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:73)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.DoAction (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour, Invector.vCharacterController.AI.FSMBehaviour.vFSMComponentExecutionType executionType) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:44)
Invector.vCharacterController.AI.FSMBehaviour.vFSMState+FSMComponent.DoActions (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour, Invector.vCharacterController.AI.FSMBehaviour.vFSMComponentExecutionType executionType) (at Assets/Invector-AIController/FSM/Scripts/Components/vFSMState.cs:161)
Invector.vCharacterController.AI.FSMBehaviour.vFSMState.UpdateState (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour) (at Assets/Invector-AIController/FSM/Scripts/Components/vFSMState.cs:99)
Invector.vCharacterController.AI.FSMBehaviour.vFSMBehaviourController.UpdateStates () (at Assets/Invector-AIController/FSM/Scripts/vFSMBehaviourController.cs:35)
Invector.vCharacterController.AI.FSMBehaviour.vFSMBehaviourController.Update () (at Assets/Invector-AIController/FSM/Scripts/vFSMBehaviourController.cs:26)
Then the second problem to which I have not found a solution. The fighters of the player should get better with time, so when they shoot they get some experience points (no problem, I found an event for that, at the weapon OnShot() ), but when they hit or kill they should get more experience points and I simply didn't find an event for that.
Is there an event which is called when the opponent is hit? I could assign the fighter to this event and give them a script for the experience points. But the script has to know how much damage someone has done and optimally if the shot was deadly... )
And the last problem:
Look at the picture. This is a mixamo character ( Remy ). And the hand is not where it should be. Is there a wrong setting or do I have to rework the animation by hand????
Thank you very much for your help, but please: Suitable for beginners -> Thank you
Damion
so I'm rather a complete newcomer to Unity and not really an experienced programmer (learning by doing, but so far I've only done websites and database connections... )
So now I wanted to realise the following: A base in the middle, surrounded by fences/walls and towers. On the towers are fighters from the player, who kill incoming zombies and gain experience.
So far so good, but there are some things I can't find out:
1st problem ) How can the zombies attack the fences/walls/towers? I put layer and tag "Defence" on them and told the zombies to find and attack them ( FSM ). They do find them, but they do not attack them. Instead of this I get:
NullReferenceException: Object reference not set to an instance of an object
Invector.vCharacterController.AI.vControlAIMelee.Attack (System.Boolean strongAttack, System.Int32 _newAttackID, System.Boolean forceCanAttack) (at Assets/Invector-AIController/Scripts/AI/AI Controllers/vControlAIMelee.cs:94)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.EngageTarget (Invector.vCharacterController.AI.vIControlAICombat controller) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:86)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.OnUpdateCombat (Invector.vCharacterController.AI.vIControlAICombat controller) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:73)
Invector.vCharacterController.AI.FSMBehaviour.vSimpleCombatAction.DoAction (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour, Invector.vCharacterController.AI.FSMBehaviour.vFSMComponentExecutionType executionType) (at Assets/Invector-AIController/FSM/Scripts/Actions/vSimpleCombatAction.cs:44)
Invector.vCharacterController.AI.FSMBehaviour.vFSMState+FSMComponent.DoActions (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour, Invector.vCharacterController.AI.FSMBehaviour.vFSMComponentExecutionType executionType) (at Assets/Invector-AIController/FSM/Scripts/Components/vFSMState.cs:161)
Invector.vCharacterController.AI.FSMBehaviour.vFSMState.UpdateState (Invector.vCharacterController.AI.FSMBehaviour.vIFSMBehaviourController fsmBehaviour) (at Assets/Invector-AIController/FSM/Scripts/Components/vFSMState.cs:99)
Invector.vCharacterController.AI.FSMBehaviour.vFSMBehaviourController.UpdateStates () (at Assets/Invector-AIController/FSM/Scripts/vFSMBehaviourController.cs:35)
Invector.vCharacterController.AI.FSMBehaviour.vFSMBehaviourController.Update () (at Assets/Invector-AIController/FSM/Scripts/vFSMBehaviourController.cs:26)
Then the second problem to which I have not found a solution. The fighters of the player should get better with time, so when they shoot they get some experience points (no problem, I found an event for that, at the weapon OnShot() ), but when they hit or kill they should get more experience points and I simply didn't find an event for that.
Is there an event which is called when the opponent is hit? I could assign the fighter to this event and give them a script for the experience points. But the script has to know how much damage someone has done and optimally if the shot was deadly... )
And the last problem:
Look at the picture. This is a mixamo character ( Remy ). And the hand is not where it should be. Is there a wrong setting or do I have to rework the animation by hand????
Thank you very much for your help, but please: Suitable for beginners -> Thank you
Damion