Did you know? UBerserker loves the Dispersion Pistol.

How to make a scrolling camera for Firetrucks?

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar LannFyre
Skaarj Scout Skaarj Scout
Posts: 31
Joined: 29 Dec 2014, 02:55

Subject: How to make a scrolling camera for Firetrucks?

Post Posted: 30 Dec 2014, 01:15

Hello,

I am new to these boards but I have a small question for. . . Whoever, I suppose. I am trying to make an RPG with Firetrucks and have a test level built, but I sadly have no experience in UnrealScript as I have only ever worked with UnrealED2's map maker. I am trying to make a camera that can scroll with the player, staying locked at a certain distance from the player by an invisible collision hull that neither the player nor pawns nor the camera itself can pass through, but will always view the player. If they player gets closer to or farther from the camera, I would need it to rotate in order to track the player. How would I go about doing this?

Thank you,
LannFyre
way2goslugger

User avatar ebd
Trustee Member Trustee Member
Posts: 442
Joined: 05 Apr 2008, 19:08
Contact:

Subject: Re: How to make a scrolling camera for Firetrucks?

Post Posted: 30 Dec 2014, 04:12

Aside from the CameraEvent and DialogueNode classes, nothing in firetrucks explicitly manages the camera. This probably isn't the answer you are looking for, but that means there is no easy way to do the things what you want.

You might try looking into SP2D (if you can find the project somewhere) and seeing how the camera was done there. That map pack had a camera that tracked the player's movement along a 2D plane while a fixed distance away, if I recall.

The best way to go about it would likely be to have a custom gametype that forces a custom PlayerPawn class, which in turn references a custom camera class (which follows and tracks its owner).

It is always nice to hear of people using firetrucks.

User avatar LannFyre
Skaarj Scout Skaarj Scout
Posts: 31
Joined: 29 Dec 2014, 02:55

Subject: Re: How to make a scrolling camera for Firetrucks?

Post Posted: 30 Dec 2014, 07:12

I actually had help from someone in order to at least make a camera track a player, but I have no idea how to make said camera stay that distance away.

Code: Select all

class RPG_Camera expands Actor;

var PlayerPawn Target;
var() vector Offset;

auto State Startup
{

Begin:
myFunction();
}

function MyFunction()
{
local Pawn P;

ForEach AllActors(class'Pawn', P)
{
if (P.IsA('PlayerPawn'))
Target = PlayerPawn(P);
Target.ViewTarget = self;
}
}

function Tick(float DeltaTime)
{
SetLocation(Target.Location - Offset);
SetRotation(rotator(Target.Location - Location));
}


As a side, would you know where I should start looking for that project?
way2goslugger

User avatar Sat42
Skaarj Warlord Skaarj Warlord
Posts: 878
Joined: 14 Jul 2013, 16:42
Contact:

Subject: Re: How to make a scrolling camera for Firetrucks?

Post Posted: 30 Dec 2014, 12:31

LannFyre wrote:As a side, would you know where I should start looking for that project?


If you're talking about SP2D:

http://www.unrealsp.org/viewforum.php?f=15

You should be able to download the mod from there. I'll have to get around to playing it someday. :)
Nali: Magic or Telekinesis
Waffnuffly wrote:It's tarydium-doped smoothies. Drunk by the player, I mean. The player is tripping balls. The whole game actually takes place in a large city and the player thinks he's on an alien world.


Who is online

Users browsing this forum: No registered users and 18 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited