0
Answered

Importing Custom character for Enemy AI

Syed Suhaib Zubair 6 months ago in Game Creator updated by Marti (Lead Developer) 6 months ago 7

I have an issue. After importing a custom character in unity for enemy AI. using Game Creator Combat Example 6. When i drag drop my character to 3d model character. the AI not holding Gun properly. Its direction is not correct. how to set this issue.

Unity version:
2019
Game Creator version:
1.6

Answer

+1
Answer

Here's an explanation for the Shooter module, and it's the same for the Melee: https://youtu.be/c2HJKxVhHh8?t=511

+1
Answer

Here's an explanation for the Shooter module, and it's the same for the Melee: https://youtu.be/c2HJKxVhHh8?t=511

Answered

Yup, as ProfPivec says, you need to enter Play-Mode and correct the values of the prefab. Then, use those values and copy them into the Offset Position and Offset Rotation fields in the Weapon asset.


The video showcases this.

Sorry you didnt get my point. What you saying the solution is working only for my character. I am holding a revolver and as per your instruction it works for my character. but i am talking about an Enemy AI which you have created in Example 6 of combat. where enemy AI follow me and shoot on me. If i change the 3d model of that enemy AI with my own downloaded enemy character then revolver in my enemy AI have wrong direction. Same revolver is in my character hand is right. how i change the values for AI?

Now see on the left side Enemy AI holding same revolver which my character have. this is the issue what i am trying to say the Enemy AI not holding just like mine after i use my enemy character. before your default character holding revolver perfect. i used lots of characters for this Enemy AI but problem remains same.

+1

Hi,i belive you will need to create a different copy of the same  weapon asset for each different model who can draw that weapon.

I dont think so this is a good solution to create again same weapon for others AI. I have created another copy of revolver. its working as just you said. but if we want have lots of weapons then we have to create duplicate copy for each AI character. This Shooter Module should have to be improved for this issue to handle weapons for AI characters.

And one more thing. if i dont use any 3d model and use default robotic builtin given enemy character then same weapon is in its hand perfect. i am using same weapon for both AI and my character. just see in image given below.

+1

What Niukeh says is correct. We're looking to decoupling how the weapon is held from the Weapon asset. Meanwhile, the solution is to duplicate the Revolver. The reason why the character is holding the weapon 90º downwards is probably because it has a different bone rotation than the one on the right.

Each 3D model has its own bone structure, and despite we can guess what a "hand" bone is, there little we can do to detect the correct rotation of the weapon out of the box. So manually fixing each offset position and rotation is the only solution.


But as I said, we're looking into solving how to decouple the position & rotation offsets from the Weapon asset.