Download

Use camera location in Kismet (custom node help)

Hey everyone, I’m working on a project with UDK and I need a way to read the camera position and rotation from Kismet. I don’t have much UnrealScript experience, but after some tinkering I came up with this node:


/**
* This kismet node is used to pass the current camera location and rotation to Kismet
*/
class SeqAct_CameraLocation extends SequenceAction;

function Activated()
{
	local PCont PC;
	local vector CameraLoc;
	local rotator CameraRot;
	PC = PContPC(GetWorldInfo().GetALocalPlayerController());
	PC.GetPlayerViewPoint(CameraLoc, CameraRot);
}

defaultproperties
{
ObjName="Camera Location"
ObjCategory="Camera"
VariableLinks.Empty
VariableLinks(0)=(ExpectedType=class'SeqVar_Vector',bWriteable = true, LinkDesc="Location",PropertyName=CameraLoc)
VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',bWriteable = true, LinkDesc="Rotation",PropertyName=CameraRot)
}

The node compiles correctly, but it doesn’t seem to be working. I feel I’m doing something wrong either when I call the GetPlayerViewPoint function or I’m not outputting the variables correctly. Can anyone help me? If there’s an easier way to output the game camera location and rotation to Kismet that’s also welcome.

Ok scrap that, I found another way to reference the gameplay camera. By using the Get Property node, setting the player as a target and putting ‘PlayerCamera’ in the property name I was able to output the current Gameplay Camera as an object. I could advance my cinematic work, but I just encountered another issue. Is there a way to animate the camera (or any other actor) in Matinee from a random location to a fixed point? If I set the keyframes to ‘World Frame’ I can move the camera to a fixed position but I also need to set a fixed starting position. If I use ‘Relative to Initial’ I can move the camera from anywhere on the level but then I can’t reach the fixed point. Is there a way around this?