void ATank::Move(float Value)
{
FVector DeltaLocation=FVector::ZeroVector;
//X=Value*DeltaTime*Speed
DeltaLocation.X=Value*Speed*UGameplayStatics::GetWorldDeltaSeconds(this);
AddActorLocalOffset(DeltaLocation,true);
}
sweep = true , 물체와 충돌했을 때 정지
https://www.unrealengine.com/ko/blog/moving-physical-objects
void ATank::Turn(float Value)
{
FRotator DeltaRotation=FRotator::ZeroRotator;
//Yaw = Value* DeltaTime* TurnRate
DeltaRotation.Yaw=Value*TurnRate*UGameplayStatics::GetWorldDeltaSeconds(this);
AddActorLocalRotation(DeltaRotation,true);
}
'Dev > Unreal' 카테고리의 다른 글
[UE5 C++] Delegate, Broadcast (0) | 2023.08.24 |
---|---|
[UE C++] UActorComponent vs USceneComponent (0) | 2023.08.24 |
[UE5 C++] TSubclassof<T> (0) | 2023.08.23 |
[UE5 C++] Unreal Editor 조작법 (0) | 2023.08.17 |
[UE5 C++] Unreal의 Class들 (0) | 2023.08.08 |