Issue related to the secret wall in Crypt Raider game

Hi, I just finished my Crypt Raider game, but I’m having an issue with the secret wall. It started to move/displace without attaching any Gargoyle grabber component. However, when I attach the Gargoyle to the wall, it gets attached and then moves down perfectly. This could be due to the Mover C++ component attached to the secret wall. I also attached this Mover component to the cell side mesh, and it’s working fine there. Additionally, I’m not able to remove the Mover component from the secret wall. I’ve attached the gameplay video and the Mover C++ file in the drive for your better understanding.

Google Drive Link

Here’s my Mover C++ code:

UMover::UMover()
{
	PrimaryComponentTick.bCanEverTick = true;
}

void UMover::BeginPlay()
{
	Super::BeginPlay();
	
	OrinalLocation = GetOwner()->GetActorLocation();  
	
}

void UMover::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	FVector TargetLocation = OrinalLocation;
	if (ShouldMove) 
	{
		TargetLocation = OrinalLocation + Moveoffsets;
	}
	FVector CurrentLocation = GetOwner()->GetActorLocation();
	float Speed = Moveoffsets.Length() / MoveTime;    

	FVector NewLocation = FMath::VInterpConstantTo(CurrentLocation, TargetLocation, DeltaTime, Speed);

	GetOwner()->SetActorLocation(NewLocation);
} 

void UMover::SetShouldMove(bool NewShouldMove)
{
	ShouldMove = NewShouldMove;
}

Privacy & Terms