Search Unity

Questions on Survival shooter Beginner game

Discussion in 'Getting Started' started by GSteele, Feb 4, 2015.

  1. GSteele

    GSteele

    Joined:
    Feb 4, 2015
    Posts:
    9
    Hey,

    I am new here and to Unity, and have been going through the beginner tutorials. I am more focused on the code side of creating games.

    I completed the Survival shooter project and it plays great,but I have a couple of questions.

    1) The included animations, they have some break points built in, or animation stop points/triggers. I was wondering if this is something animators do for their characters or if I would have to ask for it specifically or check in any assets I buy from the store?

    2) When I tried to package up the game, the UI (score/gameover) is not shown in the final executable? The health bar is showing and working. Is that an issue with my project or a limitation of the tutorial files for copyright etc.. I just wanted to share what I had done in a browser with friends/family etc..

    Thanks

    Steele
     
  2. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    Hi there,

    1) I'm not sure I understand what you mean about the animations here. Animations are made up of keyframes that dictate things like the positions of the gameobjects being animated. Is this what you mean by break points? Break points typically are things that are added to scripts to help debugging.

    2) Likewise, I'm a little confused by the terminology you've used here. By package up the game do you mean build it? Building is the process by which you would create an executable. Which platform did you build for, it sounds like perhaps the webplayer? Did you make any changes to the project that would affect the UI? Have you tried building the completed scene, if so does it have the same problem?

    Let me know what you mean and I'll do my best to help you out.

    James
     
  3. GSteele

    GSteele

    Joined:
    Feb 4, 2015
    Posts:
    9
    Hi, thanks for the feedback and sorry I was a bit ambiguous.

    1) in the tutorial, they say the enemy has an animation event, when they die. They say "At this mark in the animation, call a method called StartSinking" They have an Animation event window open and in the thumbnail for the animation, it has what looks like a keyframe tab in the time line. In the tutorial they say it is something that is setup for us.. I am just trying to figure out how.. so I can do it myself or have an animator do it for me.
    @8:53
    http://unity3d.com/learn/tutorials/projects/survival-shooter/harming-enemies

    2) Well, I finished the game, saved everything and then tried to build an executable. It ran, saved to my desktop. When double clicking the executable, the game loads, and plays fine.. but the only thing missing is the score at the top and the death screen once you die. These are part of the HUD, but the health bar is working fine, also a child of the HUD?

    I tried to save and build the game as both windows executable and web player games with the same outcome.

    When playing the game in Unity, it all works fine

    Thanks again
    Steele
     
  4. JamesB

    JamesB

    Unity Technologies

    Joined:
    Feb 21, 2012
    Posts:
    133
    Hello there,

    1) I understand now, you wish to know how to create your own animation events. Firstly there are two types of animation event, those on externally created animation, such as on an FBX and those for internally created animations - animations created in the Animation window (separate and distinct from the Animator window). I believe the type you are referring to are Animation Events on an FBX. To add an animation event to such an animation use these steps:
    • Go to the FBX importer in the inspector (this is opened by selecting an FBX in the project window).
    • At the top there are three tabs: Model, Rig and Animations. Select Animations.
    • Here each animation clip that has been made from the animation data on the FBX can be seen and edited. Near the bottom of properties of each clip there are a number of foldouts, including Curves and Events. Unfold Events.
    • Here you will see a timeline of the animation and button to the left of it. When the red line is at the appropriate point in the timeline, press the button to create a new animation event that is called at that time.
    • Pressing the button will open a dialogue box with various options. The Function property is the name of the function that will be called by the event. This string needs to exactly match the function name. When the animation event is hit, Unity will check all the public functions on the gameobject which has the Animator component.
    • The other options are for any parameters to be passed to the animation event.
    Important things to note about animation events made like this:
    • The function must be public.
    • The function can have zero or one parameter.
    • The function must be in a MonoBehaviour that is attached to the same GameObject as the Animator component. This Animator component must be using the controller that runs the animation.
    2) This could be a few different things. Chief among problems like this is that the UI elements have been placed with a pixel offset instead of using the Anchors. It is almost always best to use Anchors to position UI relative to the screen size rather than pixel offsets. To check this is the case make sure that on the Rect Transform of your missing UI elements, the Pos X, Pos Y and Pos Z elements are zero or at least very small. If instead of Pos X and Pos Y you have Left and Top, then likewise, these should be very small or zero.
    If the UI elements have already been positioned using Anchors, ensure they are children of the same Canvas as the UI elements that are appearing. If they are and are still not visible, make sure you are using the most up to date version of Unity and submit a bug report. In the report, explain exactly what is happening in as much detail as possible. Describe the steps on how to reproduce this bug with your project as closely as possible.
    The bug reporter is found in the Help menu of Unity.

    I hope this helps.

    James
     
  5. Mindchronik

    Mindchronik

    Joined:
    Feb 13, 2015
    Posts:
    1
    In the build setting, click on Add current scene and uncheck the _CompletedAsset/Scene/Level_01.unity

    You are using the premade scene from the downloadable package instead of yours.

    Took me a while to solve it, hope it helps!
     
    Kiwasi likes this.
  6. GSteele

    GSteele

    Joined:
    Feb 4, 2015
    Posts:
    9
    Thanks for all your help :)

    The issue was as @Mindchronik said. It was loading the game provided and not the game I created.

    @JamesB Thanks for your replies, I learnt a lot just from them!

    Cheers
    Steele
     
  7. Cerinne

    Cerinne

    Joined:
    May 22, 2015
    Posts:
    1
    I'm also really new to Unity, and while I was making the Survival Shooter Game I encountered a problem. Whenever I try the game out within Unity to test it out, the screen separates into 2 and I can't see half the environment and my shooter. Any ideas as to whats the problem? I attached a screenshot of my problem since a picture tells a thousand words and is far better that my explination.
     

    Attached Files: