The following is the code in the constructor of the generated class ARollingTestBall. Wishing to make the ball spin faster, I tried changing the values Ball->BodyInstance.MaxAngularVelocity and RollTorque, but the result (Ball->GetPhysicsAngularVelocity()) never exceeds 800. Can anyone tell me why?
// Create mesh component for the ball
Ball = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Ball0"));
Ball->SetStaticMesh(BallMesh.Object);
Ball->BodyInstance.SetCollisionProfileName(UCollisionProfile::PhysicsActor_ProfileName);
Ball->SetSimulatePhysics(true);
Ball->SetAngularDamping(0);
Ball->SetLinearDamping(0.1f);
Ball->BodyInstance.MassScale = 3.5f;
Ball->BodyInstance.MaxAngularVelocity = 800.0f;
Ball->SetNotifyRigidBodyCollision(true);
RootComponent = Ball;
// Create a camera boom attached to the root (ball)
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm0"));
SpringArm->AttachTo(RootComponent);
SpringArm->bDoCollisionTest = false;
SpringArm->bAbsoluteRotation = true; // Rotation of the ball should not affect rotation of boom
SpringArm->RelativeRotation = FRotator(-45.f, 0.f, 0.f);
SpringArm->TargetArmLength = 1200.f;
SpringArm->bEnableCameraLag = false;
SpringArm->CameraLagSpeed = 3.f;
// Create a camera and attach to boom
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera0"));
Camera->AttachTo(SpringArm, USpringArmComponent::SocketName);
Camera->bUsePawnControlRotation = false; // We don't want the controller rotating the camera
// Set up forces
RollTorque = 50000000.0f;
JumpImpulse = 350000.0f;
bCanJump = true; // Start being able to jump