Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 21942

UE4 zmiana pozycji

$
0
0

Cześć. Zrobiłem sobie UStaticMeshComponent, ale nie mogę zmienić jego pozycji, ani za pomocą SetWorldLocation, ani SetWorldLocationAndRotation

 

Oto kod:

// Fill out your copyright notice in the Description page of Project Settings.

#include "MyProject2.h"
#include "ForestController.h"



// Sets default values
AForestController::AForestController()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	//mesh->AttachTo(RootComponent);
}

// Called when the game starts or when spawned
void AForestController::BeginPlay()
{
	Super::BeginPlay();

	mesh->SetMobility(EComponentMobility::Movable);
	mesh2->SetMobility(EComponentMobility::Movable);
	//mesh2->SetWorldLocationAndRotationNoPhysics(FVector(3.0f, 0.0f, 0.0f));
	/*
	static bool x = true;

	if (x)
	{
		for (unsigned int i = 0; i < 4; ++i)
		{
			meshes.push_back(CreateDefaultSubobject<UMeshComponent>(TEXT("Mesh")));
			RootComponent = mesh;
		}
		x = false;
	}
	*/
	//GetActorLocation();
}

// Called every frame
void AForestController::Tick( float DeltaTime )
{
	Super::Tick( DeltaTime );


	mesh->SetWorldLocation(FVector(3.0f, 0.0f, 0.0f));
}

 


Viewing all articles
Browse latest Browse all 21942