document.write("
// Copyright Epic Games, Inc. All Rights Reserved.
#include "DandelionCharacter.h"
#include "Components/CapsuleComponent.h"
#include "Engine/World.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/PlayerController.h"
#include "Materials/Material.h"
#include "UObject/ConstructorHelpers.h"
ADandelionCharacter::ADandelionCharacter()
{
// Set size for player capsule TODO: This is from the template and it sucks.
GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);
DisableCharacterCameraRotation();
ConfigureCharacterMovement();
PrimaryActorTick.bCanEverTick = false;
}
void ADandelionCharacter::ConfigureCharacterMovement() const
{
GetCharacterMovement()->bOrientRotationToMovement = true; // Rotate character to moving direction
GetCharacterMovement()->RotationRate = FRotator(0.f, 640.f, 0.f);
// TODO: This is from the template and it also sucks.
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->bSnapToPlaneAtStart = true;
}
void ADandelionCharacter::DisableCharacterCameraRotation()
{
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = false;
bUseControllerRotationRoll = false;
}
DandelionCharacter.cpp - Snippet hosted by \"Cacher\"
");