- 9 minuti fa
Un video che mostra i nuovi tool dedicati ai sistemi iOS integrati nell'Unreal Development Kit, con un nuovo Jazz Jackrabbit come protagonista.
Categoria
🎮️
VideogiochiTrascrizione
00:08Okay, go File Open. We're going to load Kismet Tutorial Start. Now go over to the Content Browser in your
00:16Actor Classes tab. Uncheck Show Categories. Expand Pawn and Game Pawn. And we want to drag a mobile placeable pawn
00:23into the world. If you double click it it will bring open its properties.
00:26I'm going to go to the Movement tab, Location, and zero this out with a zero, zero, and on the
00:33vertical let's do a 58. Close Movement, open up Pawn, Mesh, Skeletal Mesh. Now we want to set three things
00:41in here so he can animate correctly. So go back to the Content Browser. We'll go to the Kismet Game
00:47Assets tab and right click and go Fully Load.
00:49Then go down to the Anims folder and filter by Jazz and that will just show us his stuff. Select
00:59the SK underscore Jazz Skeletal Mesh and we'll assign that to the Skeletal Mesh.
01:04And then Jazz underscore Animtree and we'll assign that to the Animtree template. And then SK underscore Jazz Anims for
01:11the Animset. So over here under the Animset section we'll hit the green plus to add a slot for it.
01:17Then hit the green arrow and that assigns that. Now he's got all the stuff he needs to animate. Close
01:22those down. Let's select him and then type in COL. Let's check on his collision.
01:30And if you hit C on the keyboard it'll show up. You can see the little green cylinder around him
01:36is this collision cylinder.
01:37So let's make that a little fatter. We'll set it to 35. Looks about right. Now let's set up the
01:44camera.
01:45So go to the Actor Classes and select on Camera Actor. I'm going to drag one of those into the
01:49world. Double click it.
01:52Go to its movement location. I'm going to zero this out to zero, zero, zero. We're also going to need
02:01two cameras.
02:02So if you hold down ALT and drag you can duplicate that one. So the first camera we're going to
02:09link that to the player.
02:10So open up its properties. Go to Attachment. And click on the little lock up here. And that'll keep this
02:19property selected.
02:21And then you can click on the character and link it. And then we'll also want to hit Hard Attach
02:26and Ignore Base Rotation.
02:27Because we don't want this camera to rotate with the player. And we're going to take this camera and end
02:32up linking it to this camera.
02:34But we want to position it first. So close this stuff down. Select this camera. And if you hit the
02:40little eyeball up here you'll take over this camera.
02:42So you can actually easily go and position it to how you want to see it in your game. That
02:48looks pretty good.
02:49So unclick the eyeball and you can move back and you can see this camera is now up in the
02:53air.
02:54And if we double click that camera, we also want to open up its camera properties and turn off Constraint
03:00Aspect Ratio.
03:00And we want to set the FOV angle to like 65. And then we also want to go to its
03:07attachment tab and hit the lock on it.
03:10And we want to select the other camera that's linked to the character and base this one off of it.
03:16And click Hard Attach.
03:18Okay, now that we've got our guy set up to animate and we have our camera set up, let's go
03:22ahead and give him some player control.
03:24So we're going to do that in Kismet, our visual scripting language. So if you hit the K up here,
03:28it'll pop that open.
03:29If you right click and go new event input, here's all the new mobile stuff that we've added for accessing
03:35the tut and tilt data coming off your iOS device.
03:39We're going to use the mobile look controller, which is basically like a thumb stick controller.
03:44You basically have two thumb sticks by default on screen. We're going to use one for his look direction and
03:50the other one for his movement direction.
03:51So this will be the right stick and it's called Uber Stick Look Zone. We'll add that in. Now it's
03:58linked up.
03:59So now we need to set up the yaw. So if we'll create a new float variable for that, right
04:04click, create a new float variable.
04:06We're going to take the yaw, which is basically the direction that the stick's pointing towards, and set it into
04:11a vector component.
04:12So go new action, math, set vector component. And we're going to drive the y with the yaw. And we're
04:20going to output that into a vector.
04:21So right click on output vector and create a new vector variable. And then connect the input active to the
04:28input on set vector component.
04:30And then from that we want to set the actor location and rotation, which is new action, actor, set actor
04:38location.
04:39And we're going to set the rotation for this actor from this output vector. So connect that to the rotation
04:44input and then connect the two nodes together.
04:47And select this node and I also want to turn off set location because we only want to set rotation
04:52on this guy.
04:54So now that that's hooked up, let's give it something to drive. We're going to drive our little pawn guy
05:00with it.
05:00So select him and then right click and go new object vary using mobile placeable pawn zero. And that will
05:07assign our pawn as the thing to be controlled by this thumb stick.
05:10Okay, so we should be all good with our rotation.
05:14Okay, now let's set up the movement control. So we'll just take the look control and hit control C, control
05:19V to paste it.
05:21You can right click, break all links. And then select it and we're going to change this to moves on
05:27instead of looks on.
05:30So this will use the left stick. Now we need to right click on strength and add a new float
05:36variable.
05:36We're going to take the strength which is basically how far away from the center of the control the thumb
05:42stick is.
05:43And that's going to drive our speed and then also we're going to take the direction to drive the movement
05:48direction.
05:49So let's, now we have our speed here. Let's take that and we want to create a rotation vector as
05:55well.
05:55So we'll right click and create a new variable for that. We're going to need to, I want to take
06:00this variable, the speed variable and multiply it by a variable so it's easy to change the speed.
06:04So let's go new action math. We want to multiply float. And then we want to drive that from the
06:15strength. And then we want to create a new variable for the B to multiply it by.
06:21So create a new variable for that. And then we want to create a new variable for the float result.
06:27And so when it's active we're going to drive the initial strength by multiplying it by this variable.
06:34Which I, let's set that to like three times. And then we're going to dump that variable out into the
06:42float result.
06:43And we're going to take the float result and use it to set the velocity for this guy. So let's
06:48do a new action actor set velocity.
06:52And we'll drive that into there. Set our target to our little pawn guy. And then we're going to drive
07:00the velocity direction from the rotation vector.
07:03And the velocity magnitude from the result of our multiply float. That should set us up to make him move
07:11around.
07:12And by the speed of how far away the stick is from the center.
07:16Okay, now that we've got this control set up so that when the control is active, he's moving the player
07:20around by the strength.
07:22We need to set up what happens when you let off. So what we want to do is manually, you
07:27know, kind of slow him down to come to a stop.
07:30The thing is with this control is when it's active, it's sending out a constant stream of data.
07:34But when the thing in active trigger is fired, it's only a one time thing. So we need to set
07:39up a little condition down here, comparison, to loop it through and to bring him to a stop.
07:44So let's do that by going new condition, comparison, compare float. And we want to compare our speed variable here
07:51in the a input to a new variable that we'll create of zero.
07:57So say when in active, go into this comparison. If the number is greater than zero, then we want to
08:03do something.
08:04What we want to do is subtract. So go new action, math, subtract float. And we want to subtract from
08:12the speed variable.
08:14We want to subtract 20, so I'll put a new variable with 20. And then we want to dump the
08:19result of that back into the speed variable.
08:22Okay, so if a is bigger than b, subtract 20, and write it back into the variable. And then we
08:29need to set the velocity again.
08:30So let's take that set velocity up there, hit control C, control V to create a copy.
08:36You can leave these connections the way they are. We want them to be the same. The reason we're making
08:41two of these is because we want to loop this one
08:43and we don't want to loop that one. So go to the select set velocity output and right click. And
08:50you can actually go set active delay.
08:51I'm going to set that to .01. And so now, after it gets done, it'll loop back through the comparison.
08:58And if the number is still greater than zero,
09:00it'll reduce it by 20 and keep going through until it comes to a stop. We don't want the number
09:06to go below zero.
09:07So to prevent that, we're going to do a new action set variable float. So if the number is less
09:16than or equal to zero,
09:17or actually just less than zero, we want to set it to zero. So we will create a float variable
09:23of zero and then drive that into the set velocity.
09:29And we need to set the target to the speed variable as well. So now we got it all set
09:34up to bring you to a stop smoothly.
09:37Okay, now that we have his control set up, let's go ahead and give him his gun. So let's close
09:42Kismet. Go around here so we can see his right hand.
09:46Open up the content browser. Drag SK underscore jazz gun into the world. If you go up to view here
09:53and go enable socket snapping.
09:56And then you can just click on the little socket into his right hand and he'll put the gun in
10:00there and attach it up. And now he's got his gun.
10:04Okay, now let's make his gun shoot. So we'll go back into Kismet and then we'll go up to the
10:09shooting area that I added.
10:11And we're going to right click, go new action actor projectile factory. Select that. And we also want to open
10:18up the content browser and go down to projectile.
10:21Get rid of the jazz filtering. Select our projectile factory. We want to add a archetype to it under the
10:29factory. And then we want to point the archetype to the blaster 01.
10:35So type in blaster 01 and that links that up. So now when this is fired it will actually launch
10:44this projectile here.
10:45We also want to set up a muzzle flash. So if you scroll up in the projectile factory settings and
10:51the PS template is the particle system to use for the muzzle flash.
10:56So we want to use the blaster muzzle 02. So select it and then hit the green arrow and it
11:01will assign it.
11:02And then the socket name, this is the socket on the gun that we want to assign for the projectile
11:10to be launched from.
11:11And so there's a socket called muzzle, M-U-Z-Z-L-E, on the front of the gun that
11:17we just added.
11:18So we also need to select our gun and then add it as the spawn point under the projectile factory.
11:25So now whenever this fires it will launch projectile from this socket at the barrel here.
11:30Now we need to set up how we're going to trigger this projectile factory.
11:33We want to use the mobile look from the right stick.
11:36So let's go, the problem with that is it's a continuous stream of data.
11:40And we need to kind of limit how often it's going to shoot.
11:43So we're going to do that by going new action, switch, and add a switch.
11:47And we're going to select the switch and set the link count to 2.
11:50And this is basically like a gate, so whenever the signal comes in from the right stick,
11:56if this index variable that we create is set to 1, it's going to spawn a projectile.
12:01And then also at that time we're going to go new action, set variable, integer,
12:08and we're going to set the index to variable of 2.
12:15So that may, it basically is dumping it into 2 and that's not going to go anywhere,
12:22so it's going to stop it from firing.
12:23And then we're going to add a new action, miscellaneous, delay.
12:31And then we're going to set our delay to, get your float variable there,
12:35and we're going to set it to like 0.2.
12:38And then after that we're going to, we can copy this set integer over to here.
12:44And we're going to break that link.
12:47And so once the delay is done, it's going to set this index variable back to 1.
12:52So every 0.2 seconds it will fire the projectile basically.
12:57And there we go.
12:59Okay, let's select all this and straighten it up a bit.
13:04Now all we have left to do is set up our camera.
13:07So let's go and go a new event, level loaded.
13:11So when the level is loaded we want to go new action, camera, set camera target.
13:18And we want to select our camera that we have in the world, that's the game camera.
13:23We want to assign that to the cam target.
13:26And if you hold down P and click, it will add a variable for the player.
13:30So basically when level is loaded invisible, we want to set that camera as the camera that the player sees
13:37through.
13:39Now we're pretty much done.
13:40Other than one thing, the other thing we want to do, now that we're using our own custom pawn,
13:44we need to take control away from the other game pawn.
13:48So to do that we're going to go new action, toggle, and then toggle input.
13:54And we're going to turn off input to the regular player.
13:57And so we just set the target of this to the same player icon.
14:02And we should be good to go.
14:03We should have a playable game now.
14:05We should be able to move around and shoot.
14:06Before I run this I want to add a quick blob shadow.
14:09So go to your mesh tab and grab smshadow01.
14:13Right click and add an interpactor.
14:16Hit F4.
14:18We want to set this to be 7, 0, and 13.
14:24With a draw scale of 0.8.
14:28And we want to lock the lock.
14:31Select our player.
14:33Base it on him.
14:35To a hard attach.
14:36And uncheck shadow parented.
14:38Now he's got a shadow.
14:41Now I want to go ahead and run this on the mobile previewer.
14:43And I'm going to use the UDK remote, which is a free app on the App Store
14:46that will let you use your iPhone as an input device to control it.
14:50These two work great together and allow you to iterate on your game really quickly.
Commenti