My Tank won't move!

My code directly returns an ASprungWheel* instead of an AActor*, and hence my implementation of GetWheels() is

TArray<ASprungWheel*> UTankTrack::GetWheels() const
{
	TArray<USceneComponent*> Children;
	GetChildrenComponents(true, Children);

	TArray<ASprungWheel*> Wheels;

	for (USceneComponent* Child : Children)
	{
		USuspensionSpawnPoint* SpawnPoint = Cast<USuspensionSpawnPoint>(Child);
		
		if (SpawnPoint != nullptr)
		{
			Wheels.Add(SpawnPoint->GetWheel());
		}
	}

	return Wheels;
}

I also removed SetThrottle() by moving the call to FMath::Clamp() into DriveTrack().

@sampattuzzi thanks for the extra course content, I believe a discourse on Physics Constraints is essential for several areas in game development involving physical realism and simulations, and I appreciate the added effort in clarifying the topic in the simplest way possible.

1 Like

There were no issues. Please treat this thread as a plain discussion on the section. :stuck_out_tongue:

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

Privacy & Terms