Question about ShotDirection.Rotation()

		FVector ShotDirection = -Rotation.Vector();
		DrawDebugPoint(GetWorld(), Hit.Location, 20, FColor::Red, true);
		UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ImpactEffect, Hit.Location, ShotDirection.Rotation());

Is ‘ShotDirection.Rotation()’ in SpawnEmitterAtLocation different from ‘-Rotation()’ here?

That should be the same, did you test it?

I didn’t! I should have just tried that first. I was just curious if there was a reason to use ShotDirection.Rotation() IE getting the rotation from the vector we just made as opposed to doing it the other way.

I got this error for that line after trying -Rotation() in the final argument place for SpawnEmitterAtLocation (“UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ImpactEffect, Hit.Location, -Rotation());”)

error C2064: term does not evaluate to a function taking 0 arguments

I’m probably just misunderstanding something fundamental about how Rotations work.

Rotation is an FRotator not a function; remove the ().

1 Like

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

Privacy & Terms