So I wanted to add an npc, I made a class called Ogre which will control these npcs. There inherit the Character class however the problem is everytime I walk near my npc in the game the camera changes position to a first person camera and I dont know why.
Code:
/*Ogre.h*/
#pragma once
#include "GameFramework/Character.h"
#include "Ogre.generated.h"
/**
*
*/
UCLASS()
class TESTGAME_API AOgre : public ACharacter
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere,BlueprintReadWrite,Category = Ogre)
uint8 health;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ogre)
uint8 movementSpeed;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Ogre)
uint8 Damage;
};
/*Ogre.cpp*/
#include "TestGame.h"
#include "Ogre.h"
AOgre::AOgre(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
// Set size for collision capsule
CapsuleComponent->InitCapsuleSize(42.f, 96.0f);
// Configure character movement
CharacterMovement->bOrientRotationToMovement = false; // Face in the direction we are moving..
CharacterMovement->RotationRate = FRotator(0.0f, 720.0f, 0.0f); // ...at this rotation rate
CharacterMovement->GravityScale = 2.f;
CharacterMovement->AirControl = 0.80f;
CharacterMovement->JumpZVelocity = 1000.f;
CharacterMovement->GroundFriction = 3.f;
CharacterMovement->MaxWalkSpeed = 600.f;
CharacterMovement->MaxFlySpeed = 600.f;
health = 100;
movementSpeed = 1;
Damage = 1;
}
Here is what it looks like when I walk near the npc, NOTE:Im using the Side Scroller Template:
As you can see the camera has changed position and its messed up.
If I move away from the npc, the camera is fine:
I want to add an npc into my scene without changing the camera, what am I doing wrong?