Landscape Collision Error (Objects go through landscape)

Error Packaging !!
Zip Project Task (Windows): RunUAT.bat ERROR: Visual studio and/or AutomationTool.csproj was not found, nor was Engine\Binaries\DotNET\AutomationTool.exe. Canā€™t run the automation tool.
UATHelper: Zip Project Task (Windows): BUILD FAILED

Is there another way ?

Verify your engine or just manually zip up the files (donā€™t include Binaries or Intermediate)
options

I tried more and more but nothing to do just Zip fire 500MG and upload into Google Drive

Itā€™s exactly as I said. Itā€™s going too fast, I reduced the acceleration and it works fine.

1 Like

Thanks @DanM a lot but i donā€™t think only the acceleration is the main problem.

Look to my video :slight_smile:

I reduced the acceleration but the problem still existing yet.
Sometimes it is working correctly and other not, i donā€™t know why does this is out of control status !!
I still searching the solution for that in this and other communities and finding that many suffer the same problem like me.

What value did you use? Using 100 seems mostly fine, only occasional problems shooting at the ground about a metre away.

Ok Mr @DanM like you, now iā€™m using 100 for acceleration but it seems super slow and i think is that illogical in real world which the missiles should be very fast. [Look to my video next]

In other worlds why should i control and reduce the speed to solve this problem !! Is there other solution to overcome that ā€¦

100 is definitely not that slow on my end. Though I am still encoutering it in some circumstances, Iā€™ll look into it a bit more.

Thanks Mr @DanM for your efforts and iā€™m waiting the new.

But i have new question please !!
I made a little bit updates to my code to be like this:


void AMissileActor::ReGuidingMissile(float DeltaTime)
{
    if(LauncherPlayerController->Hit.GetActor() != this)
    {
        FVector OUT Direction;
        FVector TargetLocation = LauncherPlayerController->Hit.Location;
        FVector MissileLocation = FrontPartOfMissile->GetComponentLocation();
  
        Direction = (TargetLocation - MissileLocation).GetSafeNormal();
        DrawDebugLine(GetWorld(), MissileLocation, MissileLocation + Direction * 100000, FColor::Green, false, 0, 0, 5);
    }   
}

I used DrawDebugLine to represent the direction of the missile so the first missile i fired worked good but the second one make illogical green line of directions Why !!? for more look to video

Ų§

Did you make any other changes? Because I tested it with what you gave me and it works as expected.

I know that one I gave you was working correctly.
I did not use GetSafeNormal with Direction.

But I made some changes in the function of ReGuidingMissile that shown in code above. The main change was by adding GetSafeNormal and unfortunately it made illogical behavior.

I was asking if you had made any other changes to the code. Because I had applied the changes you gave in that post and it worked fine.

With that said I suspect you are using Visual Studio 16.3 which has code gen bugs which will effect GetSafeNormal. You need to update Visual Studio.

Ohh !! I remembered, yes i made some changes :slight_smile:
Original Code before changes was:

void AMissileActor::ReGuidingMissile()
{
	if(!FrontPartOfMissile) return;
	
	if(LauncherPlayerController->Hit.GetActor() != this)
	{
		FrontPartOfMissile->SetWorldRotation(LauncherPlayerController->Crosshair_3D_Direction.Rotation());

		FVector TargetLocation = LauncherPlayerController->Hit.Location;
		auto MissileLocation = FrontPartOfMissile->GetComponentLocation();
		auto DeltaRotation = (TargetLocation - MissileLocation).Rotation();

		if(FMath::Abs(DeltaRotation.Yaw) <= MaxAngleOfMissileRotation && FMath::Abs(DeltaRotation.Pitch) <= MaxAngleOfMissileRotation)
		{
			FrontPartOfMissile->SetWorldRotation( DeltaRotation );
		}
	}
}

The new code is:

void AMissileActor::ReGuidingMissile(float DeltaTime)
{
	if(LauncherPlayerController->Hit.GetActor() != this)
	{
		FVector TargetLocation = LauncherPlayerController->Hit.Location;
		FVector MissileLocation = FrontPartOfMissile->GetComponentLocation();

        // GetSafeNormal has been used here to get the direction..
		auto Direction = (TargetLocation - MissileLocation).GetSafeNormal();

		FRotator TargetDirectionRotation = Direction.Rotation();
		FRotator MissileForwardRotation = FrontPartOfMissile->GetForwardVector().Rotation();
		FRotator DeltaRotation = (TargetDirectionRotation - MissileForwardRotation);
		
		if(FMath::Abs(DeltaRotation.Yaw) <= DirectionChangingMaxAngle && FMath::Abs(DeltaRotation.Pitch) <= DirectionChangingMaxAngle){
			FRotator MissileNewRotation = FrontPartOfMissile->GetComponentRotation() + (DeltaRotation * DeltaTime * FMath::Clamp<float>(DirectionChangingSpeed, 1, 6));
			FrontPartOfMissile->SetWorldRotation( MissileNewRotation );
		}
	}	
}

Thatā€™s right the version i had was 16.3.6 so i updated that to the latest one ā€¦
11
The missile are working correctly now after this updating Thanks @DanM

On the same context, i am using tanks and turrets and barrels that should aim to my pawn but there is an error in thatā€¦ [ Look to my video ] please :slight_smile:

The code based on that problem is:

void UAimingActorComponent::AimToMainPlayer(float DeltaTime)
{
	FVector TargetLocation = GetWorld()->GetFirstPlayerController()->GetPawn()->GetActorLocation();
	FVector BarrelLocation = Barrel->GetComponentLocation();
	auto Direction = (TargetLocation - BarrelLocation).GetSafeNormal();

	FRotator BarrelRotation = Barrel->GetForwardVector().Rotation();
	FRotator DirectionRotation = Direction.Rotation();
	FRotator DeltaRotation = (DirectionRotation - BarrelRotation);

	DrawDebugLine(GetWorld(), BarrelLocation, BarrelLocation + Direction * 200000, FColor::Blue, false, 0, 0, 10);
	TurretAimToTarget(DeltaRotation, DeltaTime);
	BarrelAimToTarget(DeltaRotation, DeltaTime);
}
void UAimingActorComponent::TurretAimToTarget(FRotator DeltaRotation, float DeltaTime)
{
	auto TurretRotatingAngle = Turret->GetComponentRotation().Yaw + (DeltaRotation.Yaw * DeltaTime);
	Turret->SetRelativeRotation(FRotator(0, TurretRotatingAngle, 0));
}

void UAimingActorComponent::BarrelAimToTarget(FRotator DeltaRotation, float DeltaTime)
{
	auto BarrelElevatingAngle = Barrel->GetComponentRotation().Pitch + (DeltaRotation.Pitch * DeltaTime);

	if(BarrelElevatingAngle >= MinBarrelElevationAngle && BarrelElevatingAngle <= MaxBarrelElevationAngle)
		Barrel->SetRelativeRotation(FRotator(BarrelElevatingAngle, 0, 0));
}

Do you not use source control? Because it would be much easier for me to help you.

What is that ? How can I use it?

AKA version control.

Itā€™s used to track changes a popular one is called git. The Unreal C++ Course goes over it though there is now a course on it by GameDev.tv.

On GameDev.tv:
https://www.gamedev.tv/p/git-smart-course
Or Udemy, if you prefer:
https://www.udemy.com/course/git-smart-learn-git-the-fun-way-with-unity-games/

Mr @DanM now my project is on Github platform, and still the problem existing ā€¦
https://github.com/mkscit/Anti-Tank-Guided-Missile

You have a circular dependency which you should resolve
2020-01-04 11_45_09-MINGW64__e_Projects_Repos_Unreal_Anti-Tank-Guided-Missile

With that said it seems fine on my end. I would suggest you rebuild your project.

Unfortunately, The problem still existing
I note something strange ā€¦ if we left the local direction of the tank in the same direction of the World then it will work fine, but if we rotate the local direction of tank a little bit according to World it makes that error behavior.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms