Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My solution to this would be to overwrite the default Unreal camera and program your own. Here is a quick guide on how to accomplish this. It's quite easy, really.</p> <p>The first step is to create your custom Camera class. Here:</p> <pre><code>class MyCustomCamera extends Camera; //Camera variables var Vector mCameraPosition; var Rotator mCameraOrientation; var float mCustomFOV; /**Init function of the camera */ function InitializeFor(PlayerController PC) { Super.InitializeFor(PC); mCameraPosition = Vect(0,0,0); //Etc... } /**Update function of the camera */ function UpdateViewTarget(out TViewTarget OutVT, float DeltaTime) { //This is the meat of the code, here you can set the camera position at each //frame, it's orientation and FOV if need be (or anything else really) OutVT.POV.Location = mCameraPosition; OutVT.POV.Rotation = mCameraOrientation; OutVT.POV.FOV = mCustomFOV; } </code></pre> <p>The next and last step is to set your new custom camera to be the default one. To do so, in your PlayerController class you add this is the defaultproperties block:</p> <pre><code>CameraClass=class'MyCustomCamera' </code></pre> <p>Now for your specific need of a "scrolling" camera, you could do something as simple as this in your update function :</p> <pre><code>/**Update function of the camera */ function UpdateViewTarget(out TViewTarget OutVT, float DeltaTime) { //This is the meat of the code, here you can set the camera position at each //frame, it's orientation and FOV if need be (or anything else really) //This will make your camera move on the X axis at speed 50 units per second. mCameraPosition += Vect(50*DeltaTime,0,0); OutVT.POV.Location = mCameraPosition; OutVT.POV.Rotation = mCameraOrientation; OutVT.POV.FOV = mCustomFOV; } </code></pre> <p>Hope this gets you started!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload