I seem to be stumbling.
// Fill out your copyright notice in the Description page of Project Settings.
#include "ROT.h"
#include "DefaultCharacter.h"
// Sets default values
ADefaultCharacter::ADefaultCharacter()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void ADefaultCharacter::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ADefaultCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ADefaultCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
void ADefaultCharacter::ControllerMoveForward(float AxisValue)
{
if (AxisValue != 0)
{
AddMovementInput(FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::X), AxisValue * Speed);
}
}
void ADefaultCharacter::ControllerMoveRight(float AxisValue)
{
if (AxisValue != 0)
{
AddMovementInput(FRotationMatrix(GetControlRotation()).GetScaledAxis(EAxis::Y), AxisValue * Speed);
}
}
void ADefaultCharacter::ControllerTurn(float AxisValue)
{
AddControllerYawInput(AxisValue * TurnSpeed);
}
void ADefaultCharacter::ControllerLook(float AxisValue)
{
}
This is the cpp file that handles movement. I’ll keep this short. Attaching the camera to the root causes the player to move off without the camera, but can look around. Attaching to the capsule makes the player able to move with the camera, but rotates without. Its a never-ending cycle. Anyone know how to solve?