Search Unity

Game Creator Melee Weapon Please HELP!

Discussion in 'Editor & General Support' started by InfamousMooney90, Aug 4, 2020.

  1. InfamousMooney90

    InfamousMooney90

    Joined:
    Aug 3, 2020
    Posts:
    3
    so I've pretty new to all this but I've been able to accomplish a lot and learn a good bit from tutorials. However ive run into a snag with GC: Melee Module. Everything works fine up until I 20200804_114321.jpg add the "Character Melee" component and try to choose a weapon for my player to have equipped. It gives me 0 options to choose from. The standard example asset that comes with game creator isn't working either. Ive tried turning another weapon asset into a component and that doesn't work either. Any help will be greatly appreciated
     

    Attached Files:

  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    I'm not familiar with that component, or that asset. You will probably have better luck asking the author of the asset. Maybe there's a forum thread dedicated to that asset you could search for?

    However, in general, I can't tell whether the Current Weapon and Current Shield are looking for objects that currently exist within the current scene, or whether they reference prefabs objects that merely exist within the project. I'd assume it's the first, though. In that case, you'd probably need to make sure that a "Weapon" object has been placed in your current scene. What a "Weapon" is in this case depends on that script, but I'd assume it's some game object that has a particular component on it that is also included with the asset you purchased.

    If you look at all the stuff you imported for that asset, is there a "Weapons" folder, or something like that, with some prefabs in it? If so, drag one of those into your scene, and see if it let's you assign it to that Current Weapon picker. If not, then I'd look at the code for "CharacterMelee", see what kind of component it's expecting for Current Weapon, and add one to some object in your scene. Maybe the author intends you to build your own weapons, with your own models, and s/he just provides scripts to make it all work. I don't know.
     
    InfamousMooney90 likes this.
  3. InfamousMooney90

    InfamousMooney90

    Joined:
    Aug 3, 2020
    Posts:
    3

    Well I figured out how to get the right sword into his hands but now I can't figure out how to get him to hold it by the handle. This is probably the most frustrating thing I've tried to do yet. I get rigging it but I can't seem to rig the original prefab and it won't let me use the modified sword in scene that I rigged. Any idea how to turn the edited sword into a .prefab file? I know nothing about coding and have been messing around with Unity for like 4 days now building a few game worlds and now I want to play them with a character and I'm stuck. All the tutorials by the creator seem to be from an older version and things are slightly different with the version I have. I'll try contacting the publisher Catsoft as well.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    Probably most of what you're trying to do is very specific to that particular asset you're using, so I don't have much advice on that. But two things in general might be helpful:

    First, to create a new prefab, you can just drag any game object into some folder in the Project window. Now that object will be a prefab.

    As for the character not holding the sword correctly, the typical approach is to wrap one object inside of another so you can affect its effective pivot point. For example, let's say I make a "sword" out of a simple Unity cube:

    upload_2020-8-5_10-17-33.png

    Unfortunately, as you can see, this sword will pivot around the center, of the object, which isn't what we want. So, what you can do is create an empty game object, then put this sword into it:

    upload_2020-8-5_10-19-34.png

    Just make sure that you move the SwordModel around a bit so that the whole thing rotates around the handle area.
     
  5. InfamousMooney90

    InfamousMooney90

    Joined:
    Aug 3, 2020
    Posts:
    3
    Oh sweet. That's actually super helpful thank you. I think I actually figured out what the problem was originally. It was the shader used by the character model was incompatible with the weapon. Something about needing a double sided shader to make it compatible with a 3d chat character from what I watched earlier. I scrapped that idea though and am using Uma for character design for now. Half the battle with all this is just not knowing where or how to figure out my problems that pop up when most of the solutions are super simple once I figure it out. The help is much appreciated brotha
     
  6. Blattery22

    Blattery22

    Joined:
    Apr 17, 2020
    Posts:
    1

    Hey any chance you can let us know how to put the weapon in? my options are still grayed out
     
  7. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,639
  8. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    Character Melee is not meant to manually assign the weapon and shield. You have to use a trigger and action to give the weapon to the player. Technically all you would need to do is make a trigger and on start draw your sword in an action.

    I hope this helps people in the future since a couple people had the same issue. There are many tutorials out there now and I'm following a series done by RVR on YouTube.