I am working in a Top Down template, I want to be able to use the ‘Q’ key to rotate the camera counter-clockwise and ‘E’ clockwise around player. I have been looking but can not find exactly what I am looking for.
weird i implemented this last night
so i just set up an event in the Input menu of my project called Camera Rotation under Axis Mapping, set Q and E to be 1 and -1 (or the other way round cant remember)
then pending on your setup you want to move the Camera or Spring Arms world rotation
so in my Controller blueprint I have :
Get Player Character -> Cast To My Character -> Get Spring Arm - Set WorldLocation(newRotation)
Get Spring Arm -> Get World Rotation -> Break Rot (Pitch, Yaw, Roll)
Scale from my axis mapping is then added to the value of the Yaw then I do :
newRotation = Make Rot(Pitch, Yaw + Scale, Roll)
hope this helps!
Can you post a screen shot please?
yeah of course, this is the only bit of blueprints i dont like, where as with code you can just copy n paste, with BP’s you have to take a screen shot. i know i can copy n paste the code in here, but i think unreal 4 gets upset if its referencing variables you dont have ?
ah screw it, screen shot and code (cut n paste into your Controller)
Begin Object Class=K2Node_FunctionEntry Name="K2Node_FunctionEntry_2913"
Begin Object Class=EdGraphPin Name="EdGraphPin_3386"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_3387"
End Object
Begin Object Name="EdGraphPin_3386"
PinName="then"
Direction=EGPD_Output
PinType=(PinCategory="exec")
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_451959.EdGraphPin_4201"'
End Object
Begin Object Name="EdGraphPin_3387"
PinName="Scale"
Direction=EGPD_Output
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CommutativeAssociativeBinaryOperator_776.EdGraphPin_4239"'
End Object
ExtraFlags=201457664
SignatureName="RotateCamera"
bIsEditable=True
Pins(0)=EdGraphPin'EdGraphPin_3386'
Pins(1)=EdGraphPin'EdGraphPin_3387'
NodePosX=16
NodeGuid=36E35A3F49A5BA2617002CA5AC5E5270
CustomProperties UserDefinedPin Name=Scale IsArray=0 IsReference=0 Category=float
End Object
Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_7023"
Begin Object Class=EdGraphPin Name="EdGraphPin_96362"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_96361"
End Object
Begin Object Name="EdGraphPin_96362"
PinName="self"
PinFriendlyName="Target"
PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_7024.EdGraphPin_94156"'
End Object
Begin Object Name="EdGraphPin_96361"
PinName="SpringArm1"
Direction=EGPD_Output
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.SpringArmComponent')
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_451959.EdGraphPin_4203"'
End Object
VariableReference=(MemberParentClass=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C',MemberName="SpringArm1")
SelfContextInfo=NotSelfContext
Pins(0)=EdGraphPin'EdGraphPin_96361'
Pins(1)=EdGraphPin'EdGraphPin_96362'
NodePosX=800
NodePosY=-32
NodeGuid=5D280846417481EEEFA69586EFD63803
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_451959"
Begin Object Class=EdGraphPin Name="EdGraphPin_4201"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4202"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4203"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4204"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4205"
End Object
Begin Object Name="EdGraphPin_4201"
PinName="execute"
PinType=(PinCategory="exec")
LinkedTo(0)=EdGraphPin'"K2Node_FunctionEntry_2913.EdGraphPin_3386"'
End Object
Begin Object Name="EdGraphPin_4202"
PinName="then"
Direction=EGPD_Output
PinType=(PinCategory="exec")
End Object
Begin Object Name="EdGraphPin_4203"
PinName="self"
PinFriendlyName="Target"
PinToolTip="object\'SceneComponent\' Target"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.SceneComponent')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_7023.EdGraphPin_96361"'
End Object
Begin Object Name="EdGraphPin_4204"
PinName="NewRotation"
PinToolTip="struct\'Rotator\' New Rotation"
PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Rotator')
DefaultValue="0, 0, 0"
AutogeneratedDefaultValue="0, 0, 0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_458259.EdGraphPin_4253"'
End Object
Begin Object Name="EdGraphPin_4205"
PinName="bSweep"
PinToolTip="bool Sweep"
PinType=(PinCategory="bool")
DefaultValue="false"
AutogeneratedDefaultValue="false"
End Object
FunctionReference=(MemberParentClass=Class'/Script/Engine.SceneComponent',MemberName="SetWorldRotation")
Pins(0)=EdGraphPin'EdGraphPin_4201'
Pins(1)=EdGraphPin'EdGraphPin_4202'
Pins(2)=EdGraphPin'EdGraphPin_4203'
Pins(3)=EdGraphPin'EdGraphPin_4204'
Pins(4)=EdGraphPin'EdGraphPin_4205'
NodePosX=800
NodeGuid=80B49FB840651BE3692D71B0B49F290B
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_452549"
Begin Object Class=EdGraphPin Name="EdGraphPin_4216"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4217"
End Object
Begin Object Name="EdGraphPin_4216"
PinName="self"
PinFriendlyName="Target"
PinToolTip="object\'SceneComponent\' Target"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.SceneComponent')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_4851.EdGraphPin_96367"'
End Object
Begin Object Name="EdGraphPin_4217"
PinName="ReturnValue"
PinToolTip="struct\'Rotator\' Return Value"
Direction=EGPD_Output
PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Rotator')
DefaultValue="0, 0, 0"
AutogeneratedDefaultValue="0, 0, 0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_457972.EdGraphPin_4223"'
End Object
bIsPureFunc=True
bIsConstFunc=True
FunctionReference=(MemberParentClass=Class'/Script/Engine.SceneComponent',MemberName="K2_GetComponentRotation")
Pins(0)=EdGraphPin'EdGraphPin_4216'
Pins(1)=EdGraphPin'EdGraphPin_4217'
NodePosX=160
NodePosY=-192
NodeGuid=76AA946D477134A6CE8892935757760A
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_457972"
Begin Object Class=EdGraphPin Name="EdGraphPin_4222"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4223"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4224"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4225"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4226"
End Object
Begin Object Name="EdGraphPin_4222"
PinName="self"
PinFriendlyName="Target"
PinToolTip="object\'KismetMathLibrary\' Target"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
DefaultObject=Default__KismetMathLibrary
bHidden=True
End Object
Begin Object Name="EdGraphPin_4223"
PinName="InRot"
PinToolTip="struct\'Rotator\' In Rot"
PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Rotator')
DefaultValue="0, 0, 0"
AutogeneratedDefaultValue="0, 0, 0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_452549.EdGraphPin_4217"'
End Object
Begin Object Name="EdGraphPin_4224"
PinName="Pitch"
PinToolTip="float Pitch"
Direction=EGPD_Output
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_458259.EdGraphPin_4250"'
End Object
Begin Object Name="EdGraphPin_4225"
PinName="Yaw"
PinToolTip="float Yaw"
Direction=EGPD_Output
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CommutativeAssociativeBinaryOperator_776.EdGraphPin_4238"'
End Object
Begin Object Name="EdGraphPin_4226"
PinName="Roll"
PinToolTip="float Roll"
Direction=EGPD_Output
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_458259.EdGraphPin_4252"'
End Object
bIsPureFunc=True
FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="BreakRot")
Pins(0)=EdGraphPin'EdGraphPin_4222'
Pins(1)=EdGraphPin'EdGraphPin_4223'
Pins(2)=EdGraphPin'EdGraphPin_4224'
Pins(3)=EdGraphPin'EdGraphPin_4225'
Pins(4)=EdGraphPin'EdGraphPin_4226'
NodePosX=208
NodePosY=-128
NodeGuid=ADAA7C364F13E8E64816DEB4D61E8EC5
End Object
Begin Object Class=K2Node_CommutativeAssociativeBinaryOperator Name="K2Node_CommutativeAssociativeBinaryOperator_776"
Begin Object Class=EdGraphPin Name="EdGraphPin_4237"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4238"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4239"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4240"
End Object
Begin Object Name="EdGraphPin_4237"
PinName="self"
PinFriendlyName="Target"
PinToolTip="object\'KismetMathLibrary\' Target"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
DefaultObject=Default__KismetMathLibrary
bHidden=True
End Object
Begin Object Name="EdGraphPin_4238"
PinName="A"
PinToolTip="float A"
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_457972.EdGraphPin_4225"'
End Object
Begin Object Name="EdGraphPin_4239"
PinName="B"
PinToolTip="float B"
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_FunctionEntry_2913.EdGraphPin_3387"'
End Object
Begin Object Name="EdGraphPin_4240"
PinName="ReturnValue"
PinToolTip="float Return Value"
Direction=EGPD_Output
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_458259.EdGraphPin_4251"'
End Object
bIsPureFunc=True
FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="Add_FloatFloat")
Pins(0)=EdGraphPin'EdGraphPin_4237'
Pins(1)=EdGraphPin'EdGraphPin_4238'
Pins(2)=EdGraphPin'EdGraphPin_4239'
Pins(3)=EdGraphPin'EdGraphPin_4240'
NodePosX=352
NodePosY=256
NodeGuid=FA15BB084B9DF194D4DE27802A8BA81F
End Object
Begin Object Class=K2Node_CallFunction Name="K2Node_CallFunction_458259"
Begin Object Class=EdGraphPin Name="EdGraphPin_4249"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4250"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4251"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4252"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_4253"
End Object
Begin Object Name="EdGraphPin_4249"
PinName="self"
PinFriendlyName="Target"
PinToolTip="object\'KismetMathLibrary\' Target"
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.KismetMathLibrary')
DefaultObject=Default__KismetMathLibrary
bHidden=True
End Object
Begin Object Name="EdGraphPin_4250"
PinName="Pitch"
PinToolTip="float Pitch"
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_457972.EdGraphPin_4224"'
End Object
Begin Object Name="EdGraphPin_4251"
PinName="Yaw"
PinToolTip="float Yaw"
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CommutativeAssociativeBinaryOperator_776.EdGraphPin_4240"'
End Object
Begin Object Name="EdGraphPin_4252"
PinName="Roll"
PinToolTip="float Roll"
PinType=(PinCategory="float")
DefaultValue="0.0"
AutogeneratedDefaultValue="0.0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_457972.EdGraphPin_4226"'
End Object
Begin Object Name="EdGraphPin_4253"
PinName="ReturnValue"
PinToolTip="struct\'Rotator\' Return Value"
Direction=EGPD_Output
PinType=(PinCategory="struct",PinSubCategoryObject=ScriptStruct'/Script/CoreUObject.Object:Rotator')
DefaultValue="0, 0, 0"
AutogeneratedDefaultValue="0, 0, 0"
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_451959.EdGraphPin_4204"'
End Object
bIsPureFunc=True
FunctionReference=(MemberParentClass=Class'/Script/Engine.KismetMathLibrary',MemberName="MakeRot")
Pins(0)=EdGraphPin'EdGraphPin_4249'
Pins(1)=EdGraphPin'EdGraphPin_4250'
Pins(2)=EdGraphPin'EdGraphPin_4251'
Pins(3)=EdGraphPin'EdGraphPin_4252'
Pins(4)=EdGraphPin'EdGraphPin_4253'
NodePosX=528
NodePosY=-128
NodeGuid=040DA4F242EB4F3A211414842693B8AB
End Object
Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_7024"
Begin Object Class=EdGraphPin Name="EdGraphPin_94157"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_94156"
End Object
Begin Object Name="EdGraphPin_94157"
PinName="self"
PinType=(PinCategory="object",PinSubCategory="self")
bHidden=True
End Object
Begin Object Name="EdGraphPin_94156"
PinName="MyCharacter"
Direction=EGPD_Output
PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_7023.EdGraphPin_96362"'
End Object
VariableReference=(MemberName="MyCharacter",MemberGuid=0A83AD974F9D2E6B76C6CE99E9FCCFFB,bSelfContext=True)
Pins(0)=EdGraphPin'EdGraphPin_94156'
Pins(1)=EdGraphPin'EdGraphPin_94157'
NodePosX=800
NodePosY=-64
NodeGuid=C48E44F04EBE2BB4A1336B91AED42D3A
End Object
Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_4851"
Begin Object Class=EdGraphPin Name="EdGraphPin_96368"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_96367"
End Object
Begin Object Name="EdGraphPin_96368"
PinName="self"
PinFriendlyName="Target"
PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_7022.EdGraphPin_94164"'
End Object
Begin Object Name="EdGraphPin_96367"
PinName="SpringArm1"
Direction=EGPD_Output
PinType=(PinCategory="object",PinSubCategoryObject=Class'/Script/Engine.SpringArmComponent')
LinkedTo(0)=EdGraphPin'"K2Node_CallFunction_452549.EdGraphPin_4216"'
End Object
VariableReference=(MemberParentClass=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C',MemberName="SpringArm1")
SelfContextInfo=NotSelfContext
Pins(0)=EdGraphPin'EdGraphPin_96367'
Pins(1)=EdGraphPin'EdGraphPin_96368'
NodePosX=112
NodePosY=-256
NodeGuid=CECF47BB450F3F3E67D42A90DF4DF464
End Object
Begin Object Class=K2Node_VariableGet Name="K2Node_VariableGet_7022"
Begin Object Class=EdGraphPin Name="EdGraphPin_94165"
End Object
Begin Object Class=EdGraphPin Name="EdGraphPin_94164"
End Object
Begin Object Name="EdGraphPin_94165"
PinName="self"
PinType=(PinCategory="object",PinSubCategory="self")
bHidden=True
End Object
Begin Object Name="EdGraphPin_94164"
PinName="MyCharacter"
Direction=EGPD_Output
PinType=(PinCategory="object",PinSubCategoryObject=BlueprintGeneratedClass'/Game/Blueprints/MyCharacter.MyCharacter_C')
LinkedTo(0)=EdGraphPin'"K2Node_VariableGet_4851.EdGraphPin_96368"'
End Object
VariableReference=(MemberName="MyCharacter",MemberGuid=0A83AD974F9D2E6B76C6CE99E9FCCFFB,bSelfContext=True)
Pins(0)=EdGraphPin'EdGraphPin_94164'
Pins(1)=EdGraphPin'EdGraphPin_94165'
NodePosX=112
NodePosY=-288
NodeGuid=9B7DC740423046116FE5D3B0DDBF62B5
End Object
You can also do something like this. The “RotateCamera” timeline is just a float track that goes from 0 to 360, and has loop enabled. You don’t need the “Relative Rotation” and “Break Rot” nodes, I’m only getting the pitch so it doesn’t screw with my other camera controls.
@axelZellalex Tried and will not work, I needed to add the MyCharacter var to it.
hey Garling , yea you will that is literally my MyCharacter class
as i said, you cant just copy the BP stuff
just do a Get My Character
@Tekoppar I do not see the rotate camera timeline function.
It’s just a timeline function with a float track that goes from a value of 0 at 0 seconds to a value of 360 at 5 seconds and has loop enabled.
Thanks a lot @Tekoppar , I’m working on the Top Down template and have been searching for a method for input based camera rotation. Yours work perfectly.