The Viewport

Stephen Ulibarri
A free video tutorial from Stephen Ulibarri
Engineer, Programmer, Game Developer, Author
4.6 instructor rating • 3 courses • 20,674 students

Lecture description

We cover translating, scaling and rotating objects in the Unreal Engine Viewport. We cover how to enable snapping, change the snap increments, snap to the floor, and use the different widgets for these transformations as well as learn their hotkeys. This is essential before we can start programming games using C++.

Learn more from the full course

Unreal Engine C++ The Ultimate Game Developer Course

Learn how to develop, code and package a complete video game in Unreal Engine

34:27:14 of on-demand video • Updated March 2021

  • How to program in Unreal Engine with C++.
  • How to create a complete UE4 game from start to finish.
  • Those with no experience in Unreal Engine will master Unreal.
  • Combat, adventure game mechanics, platforms, game saving/loading and menu design.
  • Those already experienced in game development will further expand their skills.
  • Those who already develop in another engine such as Unity will master Unreal.
English [Auto] OK, in this video, we're going to show you how to manipulate the objects in your world. So if you click on an object in the world, you'll see that it gets a yellow outline. And we have a little widget here that highlights when you mouse over it, that means you can click on it and drag it. The three colors of the different arrows correspond to the three axes in space. Now you can see down at the lower left of the viewport that you have a widget that's similar to what you get when you click on an object. Now, this widget shows you the directions of the X, Y and Z coordinate axes in space. What these are the definite directions in space for your level and for your world. Think of it as a sort of compass that will tell you which direction points north and east only instead of north and east. We have the X direction and the Y direction and of course, up and down is the Z direction. So if I have this chair selected, I can click on the Blue Arrow and drag it up and it'll drag up and down in the air. Now notice it's dragging up and down in discrete increments. This is because it's snapping to a particular amount of units in space. Now you'll see these different items up here at the top right of the viewport. And when you hover over them, it'll tell you what they do. This orange highlighted little menu here says enables or disables snapping to the grid when dragging objects around. If you click on it, it's no longer selected, so snapping is actually turned off. So if you click and drag now, you'll see it's more, more continuous and you don't really have to worry about it snapping to a particular amount of space in the world. But if you turn it back on, it will snap. Now, right here, set the position grid snap value. You can change this to whatever size you like. Now, this is referring to unreal engine units, which are by default centimetres. So what I'm doing is moving it up and down by a single centimeter at a time now because I had turned snapping off and moved it around continuously and then turn snapping back on. It may not actually link right up to the floor. Exactly. There might be a little bit of a gap because when I turn snapping off, I was then able to move it a nondescript number of centimetres. So that's why snapping is very handy. It can help you to keep things snapped to the ground or to any position you would prefer it to be snapped to. Now, if I lift it up with snap on or off, there's a way for me to bring it back down just so it's touching the floor. And that's why hitting the end key, if you hit the end key with an object selected, it will snap to the floor wherever it is in the world. For example, this little object on the table here, I can lift it up above the table and hit end and it will snap back down to the table. But if I move it off the table and hit and it'll snap to the floor. So whatever's below that object in the world, that's what it'll snap to when you hit the end key. Now, if we select our chair again, we can choose to manipulate this chair in different ways other than just moving it around in space, using the Green Arrow moves it in the Y direction and the arrow moves it in the X direction. That's translation through space. But we can also go up here to these icons and will hover over the one that selected it, says select and translate objects. And that's W for the hockey. Or we can move over here to select and rotate objects and that's E for the hockey. So if we click on that, you'll notice the widget changes and now let's right click and left and right click at the same time to drag ourselves over so we can see the widget a little better. And you'll see that one is red ones, green ones blue. If we click and drag on the blue one, we're actually rotating the object around the Z axis. So the Z axis is pointing upward. We're rooting around that axis. If we click on the red and drag, we're rotating around the x axis and of course, the green rotates around the Y axis. Now, notice, when I click, this little circle pops up and as I drag its. Rotating by 10 degree increments, and it shows that right here we're at 10 degrees here at 20 and so on. So if you want it to rotate it exactly 90 degrees, you can do so easily. But if you didn't want these discrete rotational amounts, we can go up here where it says enables or disables snapping objects to a rotation grid and we can click it to disable it and then we can rotate it as much as we want. And this little widget still shows us how much we have rotated it. So we'll turn that back on and then we'll go up here and we'll see that next to this icon. We have select and scale objects and are is the key for that. So if we click that now, the widget shows these little boxes. Now, if I click and drag on the blue one, we're scaling up in the Z direction. So it's getting taller and then we can scale it back down. If we want it to be shorter and fatter, we can scale in the Y direction, if we want it to become much wider and the X direction, if we want it to become more sort of like a bed or a mattress. So those are scaling in the X, Y and Z axes. Notice, however, there's a white box in the middle and when we hover over it, the entire widget gets highlighted and that allows us to scale the entire object and all three axes at the same time. And of course, if we go up here to the icon with the arrows as it enables or disables snapping objects to a scale grid, if we disable that, we'll see that we can actually scale it without using discrete increments. It's more a continuous level of scaling now right here next to that icon R scale snap parameters. And this allows us to snap to larger increments as we turn on snapping. So we've learned how to translate objects throughout space, we've learned how to rotate objects and we've learned how to scale objects and we know how to turn on and off snapping for these different modes so we can have a sort of set increment by which we can scale, rotate or translate these objects, or we can turn off snapping and use a more organic, smooth approach where it's flowing continuously from one size to another.