I’m currently creating a game and I want the player to be able to turn 360 degrees midair like the game Severed Steel. however, I’m quite new to Unreal Engine and do not know how to. any help would be greatly appreciated
after looking up some gameplay footage https://www.youtube.com/watch?v=eOL3KfbiMIE this looks like it could be accomplished through the “First Person Shooter Template” adding a leaning system.
for the bullet-time “slow motion” stuff could probably be done with Time Dilation
https://www.youtube.com/watch?v=y2DtVnOugVY .
if Time Dilation is set to “too small” of a number it can cause unexpected interactions with physics (similar to in Bethesda’s Fallout 3 when entering VATs could cause the player character or another character to fall through the ground), so I would suggest not going lower then like 0.05
the other option is to set the players time dilation to a higher value, and then slow down the world around them.
360 on the yaw or pitch?
I think it only shows it once during that video at 7:40 but I’m trying to make the player be able to turn 360 degrees on the pitch axis while midair
Pitch
to keep the character in the air longer you could lower their mass (to reduce the effect of gravity), though if you are going to be using physics based forces this could have negative effects.
the other option is to use the time dilation where reducing time scale for the player it should reduce the acceleration affect of gravity.
the angle of rotation will mostly be based on rotation rate, which if you say use raw mouse input a mouse with high DPI could rotate much faster then a mouse with lower DPI or even a Joystick.
the feel of it would mostly come down to fiddling with numbers.
thank you but I Have already done slow motion. Im trying to unrestrict the cameras pitch axis allowing flips midair. something like https://www.youtube.com/watch?v=eOL3KfbiMIE at 7:40 where they do flip to get behind the shield
There is code in player character or in player controller that manages mouse input and rotating camera. Find it and modify.
To be honest, I’m not sure the default character movement component is going to work well. From what I can see, it won’t allow for rotation in the air. I don’t think rotating the camera is what you’re looking for, I think the whole character needs to be able to pitch and roll.
If it was me I’d make my own movement code. You can try using physics, so for jump you’d add an impulse, then when in the air you can add rotation to your capsule, but the issue with the built-in physics is that it’s hard to control and you’re going to have side-effects.
I know this might be a bit intense, but you can use a simple integration for you gravity and momentum.
This is c++ but easy to do in blueprint as well:
void APlayer1::Integrate(float DeltaTime)
{
FVector Vel=Position-PositionOld;
Vel=Vel+(Gravity*DeltaTime);
PositionOld=Position;
Position=Position+Vel;
SetActorLocation(Position);
}
This code also makes jumping fairly easy. You can just set the PositionOld below the character this will create upward velocity.
Not sure if you are going to use wall running, but there will be some challenges there.
For your pitch and roll you can simply do a line trace each frame to see if you’re on the ground, if not, then you enable the controls to rotate the player. If you’re on the ground you reset the player rotation x and y to 0. You’ll probably want to use an FInterp or something similar just to smooth out the snap to upright.
Hope this helps a bit.