Spawn a projectile error

Hi there , im trying to do a rocket launcher system.
And when i make the spawn of the projectile , i get this error when building

1>  RocketLauncher.cpp
1>C:\Users\Rui\Documents\Unreal Projects\pap\Source\pap\Private\RocketLauncher.cpp(25): error C2664: 'T *UWorld::SpawnActor<ARocket>(UClass *,const FVector &,const FRotator &,const FActorSpawnParameters &)' : cannot convert argument 1 from 'ARocket *' to 'UClass *'
1>          with
1>          [
1>              T=ARocket

Here is the one piece of code with an error mark on the → symbol :

ARocket *const Rocket = GetWorld()->SpawnActor<ARocket>(ProjectileClass, MFLoc, MFRot, SpawnParams);

1>          ]
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

Any help ?

Could you provide the definition of ‘ProjectileClass’?

The typical way on doing this would be:

ARocket *const Rocket = GetWorld()->SpawnActor<ARocket>(ARocket::StaticClass(), MFLoc, MFRot, SpawnParams);

or just

ARocket *const Rocket = GetWorld()->SpawnActor<ARocket>(MFLoc, MFRot, SpawnParams);

Does this work for you?

worked with the 1st option u placed , thank you Moss

Nice! Make sure to accept the answer to make it valuable to other ^^

Have a nice day!