Solider Package From the Asset Store

So I downloaded the solider package from the asset store and I was wondering on how i can make them move and shoot like the solider in the bootcamp demo.

You need to make scripts for them.

Really? Do you know where I could get some scripts?

You’ll probably just have to learn to script.

In unity, go to help, then click scripting reference.
Also check out some tutorials here on the forums and on the website.

Its easier than you think :slight_smile:

You will need an AI script wich is hard to make .

It’s not that hard to do!

…too bad the package didn’t come with a basic control script, at least for showcase purposes.

But if you’re going to do this, better start now right? Start with the platformer tutorial!

Good luck!

Learn Scripting, open up the bootcamp demo look at how things works. Look at some basic Unity tutorial. And hopefully, you get to make your own game soon. :smile:

3D animation is done using “rigs”.

These are very similar in concept to the “armatures” seen in stop-motion animation. (E.g. pretty much anything by Aardman Animations, of ‘Wallace Gromit’ fame.) In stop-motion animation, you build a metal or plastic ‘skeleton’, called an armature, and model your character around it using clay. (This is also why the technique is sometimes known as “claymation”.) That skeleton keeps the character rigid, stops bits of it falling off, allows you to replace the head to change its expression or lip movements—you create multiple heads for this purpose as moving such tiny details individually would take forever—and more.

In 3D animation on computers, you still have that “skeleton” structure, but we call it a “rig”, hence the term “rigging” in 3D graphics circles. Each movable element of a rig is known as a “bone”. This stuff is entirely separate from the model you see on the screen: you never actually “see” a rig as such, even when you frag a player in an FPS.

The crucial difference is that, because everything is just numbers to a computer, you can take a rig and reuse it “inside” multiple models that share similar physical characteristics, so you can save a lot of time by animating a single rig, and applying that rig to multiple models. Thus, when we refer to animating a model, what we’re really doing is animating its rig.

Linking a rig to a particular model is known as “skinning”. This process tells the renderer how each part of the model relates to the rig’s elements. For example, if you move a rig’s “left arm” component, you want your model to move its arm too, but you also want the model’s skin, clothing, etc.

Furthermore, if your model needs to support facial expressions, you might add a few “bones” to the rig to handle eye movements, lip movements, eyebrow-raising, etc. The virtual bones therefore do double duty here as “virtual muscles”. (If you watch a Pixar “Making of…” documentary, you’ll usually see these “expression” bones demonstrated a couple of times when they show you how the characters are modelled.)

The upshot of all this is that you animate a rig, not the model itself.

So…

Animating your soldiers—I assume that’s what you meant—means attaching them to a suitable rig. If they come already rigged, that means the “skinning” process has already been done for you. Which is a good thing as it can be very hard to get right—especially if you’re not an artist!

Assuming your models have been “skinned”, you now need to see if those rigs have been provided with suitable animations.

If they have, great! You can use Unity’s animation scripting features to select and play rig animations for your models. E.g. if the character is moving quickly, you’d switch to a “running” animation; if the character has stopped, you want to switch to a “standing still, cracking jokes with his friends” animation, and so on.

If no animations are provided, you’ll need to build these yourself using a 3D modelling or animation package. Unity is a “game composition” tool: it expects the assets you provide to be feature-complete, much as Adobe’s InDesign doesn’t support every feature in Photoshop, but expects you to provide photos already processed instead.

Animating a rig is similar to most animation: you select a starting ‘pose’, store it as a keyframe, then move the rig into another pose, set that as another keyframe, and let the program calculate the points in between. Repeat until done. It’s not easy to do if you’re a novice, and animation is a skill in its own right.

Hopefully, your asset package includes animations.

Don’t you need animation to make them move and then several scripts. Cause I have this guy making me a Army soldier and he is making animations for the character.

“Animation” is a bit confusing in this context…

On the one hand, “animation” can just mean “moving a model from A to B”. (“Animation” is just a fancy word for “movement”.)

This is what those Character Controller scripts that come bundled with Unity do: they read the player’s input and move the character model around by modifying its GameObject Transform directly. BUT, the character will just slide around: the legs won’t move, and neither will anything else. It may even bop up and down steps and other small obstacles.

But the model’s rig won’t animate at all without further scripting, because Unity has no idea what rig animations you have created, how they’re supposed to work in the context of the game, and so on. Unity is a generalist.

You therefore need to link that character control animation to the rig animations using your own scripts. The scripts will look at what the player is doing, and choose the correct rig animation for your character model while Unity takes care of moving it physically around the scene.

The above also applies to pretty much every other entity in the game, not just the player: Unity can take care of things like physics, but it doesn’t “know” that your model is a “soldier with large gun”. You have to tell it that. That’s what the scripting is for.

Don’t the scripts I need come with bootcamp demo?

The scripts in the Boot Camp demo will indeed include those that switch between the different animation rigs, but those rigs (and their animations) will have been created specifically for the Boot Camp models, so you will probably need to tweak any animations that don’t fit your own game.

But they’re a good starting point, yes.