Download

is it bug or did I miss something?

Kudos to Unreal Engine Community from my last post, yet I may need another help again the or silly thing… I am not certain it a s bug or my mistake…

Just like I edited BP of my C++ pawn’s Rotation - actually Yaw (Z axis), I also want to set if my character is facing left, i want to rotate it with -90 Zaxis. As for Right direction, 90 z axis in C++

Last project, it worked fine. but current project, Z axis does not rotate, but only X axis. Even I put value at each different axis in C++ but does not work either…

Hmm… I am feeling clueless again…

here goes the code.

Base_Character.cpp (the actual code)



void ABase_Character::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);

    if (m_i8CharDirection == ECharacterDirectionEnum::CHDE_LEFT)
    {
        FRotator  rot(0.0f, 0.0f, -90.0f);
        this->AddActorLocalRotation(rot);
        //this->AddControllerYawInput(-90.0f);
        //this->SetActorRelativeRotation(rot);
    }
    else
    {
        FRotator  rot(0.0f, 0.0f, 90.0f, );
        this->AddActorLocalRotation(rot);
        //this->AddControllerYawInput(90.0f);
        //this->SetActorRelativeRotation(rot);
    }
}


I even tried put value at each different axis, but I got same result (only X axis only working, not Z axis :frowning: )

Without knowing more information about the intended result (What is your camera angle/point of view, what type of movement are you intending as the end result, etc.) giving suggestions on ways to fix this is very difficult. Normally I’d ask why you’re setting a constant Rot instead of getting the current control rotation and using that as your baseline, but you might not need that depending on your game.

sorry for lack of information. my camera is fixed (for now), because it is 2D scroll RPG game. if i want my character (Sprite) face left I need certain rotation value. I think I gonna try to make new project because when I changed from 4.15 to 4.17 version, it causes numerous errors and perhaps bugs… too?(not certain, maybe). Even though it will be frustrating. but those weird situations irritated myself too much. Anyway… thank you for reading it :slight_smile:

I created in new project… Even though I disabled every rotation code in C++, my pawn rotates itself like tap dancing. -_-;;; I am not sure it is bugF or did i touch Physics or something? I am pretty sure i never touched Physic component yet.

after i did C++ visual studio building the solution and compile in Editor, it stopped tap dacing (rotating itself) but it does not move as pressed specific input. Very peculiar… i will fix it soon.

Fixed it!