Hello everyone,
I have a simple Puzzle Game.
It is a combination of multiple simple games. Since those games are rotated during the game, everything is spawned dynamically.
I have a problem with SpawnActor.
There is a class called XGame(AActor) spawned by level manager(APawn) . It is responsible for spawning actors for this specific X game.
XGame.cpp
const FVector ActorLocation = GetActorLocation();
const FVector StickLocation = FVector(0, 0, 0) + ActorLocation;
const FVector BallLocation = FVector(0, 100, 0) + ActorLocation;
const FVector CircleLocation = FVector(0, 200, 0) + ActorLocation;
UWorld* World = GetWorld();
AXStick* Stick = World->SpawnActor<AXStick>(StickLocation, FRotator(0, 0, 0));
AXBall* Ball = World->SpawnActor<AXBall>(BallLocation, FRotator(0, 0, 0));
AXCircle* Ball = World->SpawnActor<AXCircle>(CircleLocation, FRotator(0, 0, 0));
The problem is, everytime I spawn an actor its X coordinate is increased by 68. (I don’t know why 68)
For instance;
stick is spawned at 0, 0, 0
ball is spawned at 68, 100, 0
circle is spawned at 136, 200, 0
all of them are ACharacter
I would be really appreciated if anyone can help