AGameObject* AGameObject::SetParent( AGameObject* newParent ) { USceneComponent *pc = 0; if( newParent ) pc = newParent->GetRootComponent(); SetOwner( newParent ); // Keep original scale & reset FVector s = GetActorScale3D(); //LOG( "Scaling %f %f %f", s.X, s.Y, s.Z ); // Set the world position to being that of parent, then keep world position on attachment GetRootComponent()->SetWorldScale3D( FVector(1,1,1) ); // reset the scale off GetRootComponent()->SetRelativeScale3D( FVector(1,1,1) ); GetRootComponent()->SnapTo( pc ); GetRootComponent()->SetWorldScale3D( s ); // don't set scaling relative to parent.. set it absolute in world size coords return this; }
void ABouncerPlayer::Shrink() { SizeFactor--; SetActorScale3D(GetActorScale3D()* SHRINK_FACTOR); }
void ABouncerPlayer::Grow() { SizeFactor++; SetActorScale3D(GetActorScale3D() / SHRINK_FACTOR); }