Hello, and sorry if this seems a rather helpless-sounding post to make, but I have been looking around and fiddling with my problems for a little while now.
I am completely new to Unreal Engine, and have looked at the various documentation-tutorials for movement, also looked at Tom Looman’s rather extensive survival project, but I didn’t feel like I could just dive into it right now. So currently what I wanna attempt is a decent movement/camera system.
Character class for input
So, I think I understand the use of Player Controller for Pawn movement/input, but it seems some use it for the character class, too. Is there a good reason for that? I’d otherwise just insert all input events into the actual character class.
Pawn/Character Movement
I noticed, if I simply use the UE4 documentation code for pawn input and insert it in my character, it will never stop even when not pressing down the button. It seems pretty obvious to me that this is because the FVector CurrentVelocity is never reset in the UE4 documentation. I just fixed it by adding an else statement to the MoveForward()/MoveRight() functions of which sets it to zero
void ACharacter::MoveRight(float Val)
{
if ((Controller != NULL) && (Val != 0.0f))
{
CurrentVelocity.Y = FMath::Clamp(Val, -1.0f, 1.0f) * 100.0f;
}
else
{
CurrentVelocity.Y = 0.0f;
}
}
But then, did I miss something? Because I don’t see how it actually works without resetting the CurrentVelocity inside of the UE4 documentation (Pawn Class) - Yet it does.
Mesh vs. Capsule of character
The capsule as I understand is the actual way of knowing if you are about to collide with other physical objects while the Mesh is simply an visualization of the object (Even though I guess collision can be trigged somehow with the mesh?).
So in my case, I simply added the UE Mannequin skeleton as mesh, and the model ended up standing in the middle of the capsule, which meant it was floating in the air (I would love to upload a picture, but apparently it is harder than I imagined). I decided to simply move the Mesh component in the editor (Moved it in the Z-axis), until it was “standing” on the floor. Are there any other, more efficient way of doing this? Perhaps in code - or is this simply faster in the editor?
I come with a small background in C++, and that is really the biggest reason for me to try and implement things in C++ in UE4. I have not looked at blueprint as of yet, but I probably will, when I feel somewhat able to stand on my own, at least some of the way. Sorry if there are any duplicates of the questions.
Regards,
Boooke