Talk:First Person Shooter C++ Tutorial

From Epic Wiki
Jump to: navigation, search

Comments

Answer to the comment below: That's because there is an error in the chapter "Making a Character", the code for the FPSGameMode constructor should be:

AFPSGameMode::AFPSGameMode(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{
	DefaultPawnClass = AFPSCharacter::StaticClass();
}

I'm not proficient at editing wiki's so will just leave this comment. Earlier today while working on the tutorial at the step where we add FPSCharacter I noticed that when using the PIE feature in the editor that the text "We are using FPSCharacter!" did not appear. I did appear however when building & launching. What made the difference for me to get it appear in the PIE was to both close the editor, and the launcher. The tutorial step 1 in that section (and other sections) only mentions closing the editor.

Great tutorial. A link to the full correct code to diff against what I have would be a welcome addition. I've gotten to a section where I've done all that is specified in the tutorial but my character is not moving (just finished the WASD movement section). My debug prints show up fine but I'm wondering if I put a line of code in the wrong spot.


I am confused as to the purpose of this tutorial. It relies very heavily on the UE4 engine to do almost everything -- even down to scripting, animation and so forth. What is the point of working with C++ directly if you don't really do anything that isn't already built into the engine? Is there a FPS tutorial that doesn't have "start up the UE editor" as most of its content? -- JW

Bugs

I spent a good while stuck on "Adding a First Person Mesh", step 3. Turns out, at some point, Mesh was made inaccessible. I attempted to replace it with GetMesh() (did something similar for "Changing the Camera View" step 2), and it seems to be compiling now, but doing nothing. I eventually went into the Blueprint Editor and clicked "Open Full Blueprint Editor"; in the Components pane, selected Mesh (Inherited); and in the Details pane, expanded the Rendering section with the "Show Advanced" arrow, and manually checked "Owner No See". Perhaps someone else could confirm? I will continue to leave GetMesh()->SetOwnerNoSee(true); in my code for now. I have UE 4.12.4. --FailsWithTails (talk) 05:44, 2 July 2016 (UTC)

I cannot get GetMovementMode node to work properly inside the animBlueprint Event Graph in the way described. Did this get deprecated? -DanaFo (20/4/2015)

Something is off with the sections "Changing the Camera View" and "Adding a First Person Mesh". I've declared and defined the public properties for FirstPersonCameraComponent and FirstPersonMesh. After compiling in Visual Studio and restarting UE4, the properties are not visible on the BP_FPSCharacter blueprint. However, if I delete the blueprint and create it again, I can now see the new properties. -- unknown commenter (Added workaround, issue is being looked into - 6/20/14 - TJ)

I had the same problem that the above poster mentioned. Deleting and re-creating the BP_FPSCharacter blueprint fixed it for me. I tried reparenting the original blueprint, but that didn't work for me. I searched for information about how to make new properties appear for a blueprint based on a base class, but couldn't find anything about that. I'm going to make a note in the tutorial for now. --Unoti (talk) 00:39, 20 June 2014 (UTC) (Added workaround, issue is being looked into - 6/20/14 - TJ)

Project Settings/Set as default: In the current version of the editor, it doesn't look like "Set as default" is needed anymore to save the settings. It's actually disabled for me. It looks like this may have been different in an earlier version of the editor. I didn't have sufficient confidence in what I was doing to make edits to the tutorial along these lines, though. (Fixed 6/20/14 - TJ)

Restarting the editor: It doesn't appear that restarting the editor is needed as much in the current version as this tutorial describes.

Add the JumpStart to JumpLoop Transition might have the wrong image: Looks like the wrong image is being shown, it should show FPP_JumpStart Asset [Time Remaining] rather than FPP_JumpEnd Asset [Time Remaining]

i'm on the section "Changing the Camera View" and i've followed the tutorial but after i compile the code it says error and no matter how many times i edit the code it still wont work so here's my code :

FPSCharacter.CPP AFPSCharacter::AFPSCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { // Create a CameraComponent FirstPersonCameraComponent = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera")); FirstPersonCameraComponent->AttachTo() = GetCapsuleComponent(); //Line 85

// Position the camera a bit above the eyes FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 50.0f + BaseEyeHeight); // Allow the pawn to control rotation FirstPersonCameraComponent->bUsePawnControlRotation = true; }

i got 5 errors : - expression must be a modifiable lvalue line 85 - too few arguments in function call line 85 - 'USceneComponent::AttachTo': function does not take 0 arguments line 85 - etc - etc