# Looking for Ue4 C++ command equivalents (Unity)

**URL:** <https://forums.unrealengine.com/t/looking-for-ue4-c-command-equivalents-unity/456203>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 29, 2019, 10:35pm UTC](https://forums.unrealengine.com/t/looking-for-ue4-c-command-equivalents-unity/456203 "2019-09-29T22:35:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejakulatje](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ejakulatje](https://forums.unrealengine.com/u/ejakulatje)\
**Post date:** [September 29, 2019, 10:35pm UTC](https://forums.unrealengine.com/t/looking-for-ue4-c-command-equivalents-unity/456203/1 "2019-09-29T22:35:41Z")

</div>

I’ve searched pretty long and didn’t found the equivalent these two commands, maybe someone of you knows the ue4 C++ version:

```
Quaternion.identity

```

> **[Unity - Scripting API: Quaternion.identity](https://docs.unity3d.com/ScriptReference/Quaternion-identity.html)**

```
Quaternion.FromToRotation()

```

> **[Unity - Scripting API: Quaternion.FromToRotation](https://docs.unity3d.com/ScriptReference/Quaternion.FromToRotation.html)**

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [September 29, 2019, 11:15pm UTC](https://forums.unrealengine.com/t/looking-for-ue4-c-command-equivalents-unity/456203/2 "2019-09-29T23:15:26Z")

</div>

Quatification type in UE4 is FQuat and you can find all you need in API reference:

> **[FQuat](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FQuat/)**

The Identity is a static const at the end of API refrence so you get it like this:

```
FQuat::Identity

```

Getting it from Rotation (which in UE4 is FRotator) you can either do that by direcly constructing FQuat from FRotator:

```
FQuat(FRotator(Pitch,Yaw,Roll))

```

or from convert directly from function in rotator:

```
FRotator(P,Y,R).Quaternion()

```

> **[FRotator::Quaternion](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FRotator/Quaternion/)**
>
> Get Rotation as a quaternion.

Explore recommand APIre refrence, here basic geometric types:

> **[FVector](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FVector/)**

> **[FVector2d](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FVector2D/)**

> **[FRotator](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FRotator/)**

> **[FTransform](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FTransform/)**

All basic math operations contained n FMath it has operations for C++ primitives like int32 and float, all of them are static functions do you call them starting with `FMath::` :

> **[FMath](https://docs.unrealengine.com/5.1/en-US/API/Runtime/Core/Math/FMath/)**
>
> Structure for all math helper functions, inherits from platform math to pick up platform-specific implementations Check GenericPlatformMath.h for additional math functions

[FGenericPlatformMath | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/API/Runtime/Core/GenericPlatform/FGenericPlatformMath/index.html) (use `FMath::` for those regardless)
