Tutorials

Moving View



What were going to do here is have a moving point_viewcontrol. We’re going to have it track Barney where ever he walks. What this is good for is having a movie like cut scene or making your own in game machinima. This is really easy so lets get started.

news post image

The first thing your going to need is, you guessed it, is something to track. In this case we are going to use Barney. So put in a generic_actor entity and make it the Barney model and give it the name of Barney. Next you are going to need your point_viewcontrol entity. So put that in your level (in my example map its right in front of Barney). Here is the list of keyvalues to change.

Name: point_viewcontrol
Pitch Yaw Roll: click on the Point At button and point it at barney's eyes
Entity to Look At: barney
Target Attachment Name: eyes
Path Corner: path_track01

Under the Flags tag check only Freeze Player and Infinite Hold Time.

Now that we have our point_viewcontrol ready we need to get it to move. To do this we need a path_track entity. When you put this in your level it needs to be in the same space that your point_viewcontrol is. This is because when you trigger the point_viewcontrol and want it to start moving you’re going to have the point_viewcontrol playing catch up to the path_track. It’s easier to have the path_track and the point_viewcontrol right with each other so you how its going to move. Here is the list of keyvalues to change.

Name: path_track01
Next Stop Target: path_track02
New Train Speed: This is up to you. Example map is 90

I should point out that you can also use path_corner in place of a path_track or both. The nice thing about using a path_corner is that it has a Wait Here value so you could pause your point_viewcontrol.

And that’s about it. In the example map I have it set up to start as soon as you walk into the trigger. Once triggered, your view will switch to the point_viewcontrol. It and Barney will start moving and the point_viewcontrol will track barney.

As you can see there are endless ways to use this. The one thing that I haven't got working yet is how to control the speed that the point_viewcontrol looks at what you have it set to look at. It seems to have just one speed. For example, if you set the point_viewcontrol in one spot and have Barney walk right pass it, it will not speed up to keep tracking right on barney's eyes. It will move at its set speed and sort of play catch up. If anyone knows how to fix it please let me know.

Example Map

To have it exit the viewcontrol just add an output from whatever you want (such as the last path_track) to disable the viewcontrol. Once disabled, the player will be in control again.

booker

View comments ( 9 )

Back to top