Actor Spawn С++

I create a new actor and set the value of a variable.

How would this code look like in C++?

GetWorld()->SpawnActor<AOsnPersonazh>(FVector(0.f, 0.f, 0.f), FRotator());

How do I assign the value 10 to a variable?

	AOsnPersonazh* SpawnedOsnPersonazh = GetWorld()->SpawnActor<AOsnPersonazh>(FVector(0.f, 0.f, 0.f), FRotator());
	SpawnedOsnPersonazh->NewVar1 = 10;
1 Like

Thank you friend.

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