# Binary ‘==’: no operator found? FTransform == FTransform

**URL:** <https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457>\
**Category:** C++\
**Tags:** UE4-20, unreal-engine, UE4, CPP, question\
**Created:** [August 14, 2022, 11:25pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457 "2022-08-14T23:25:26Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:11pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/21 "2022-08-15T18:11:30Z")

</div>

Yea these are float point coords. Maybe unreal has limited the use of == with floats and it’s thowing the intended error, even if it works you are going to get a wrong output.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:13pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/22 "2022-08-15T18:13:07Z")

</div>

doing this in blueprint gives me the correct exact output location to spawn an actor.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:13pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/23 "2022-08-15T18:13:29Z")

</div>

![image_2022-08-15_231320128](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/a/f/daf6342a95ba649eac8752294e225c426b1130d2.png)

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:14pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/24 "2022-08-15T18:14:24Z")

</div>

![image_2022-08-15_231418041](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/f/d6fd0f7e9f31e69576e79d7767998cd90724dbbf.png)

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:14pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/25 "2022-08-15T18:14:26Z")

</div>

well yea because it’s using a library with a function from it for conversion.  
You should round up the numbers and turn them to integer, but you have to catch the float array with [float index to int]

Your vector array[int index] = Transform (x,y,x)

Besides the float you will get a copy with an int for it.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:18pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/26 "2022-08-15T18:18:30Z")

</div>

I am trying to implement this library for C++ but member

| Severity | Code | Description | Project | File | Line | Suppression State |
| --- | --- | --- | --- | --- | --- | --- |
| Error | C2248 | ‘FTransform::Translation’: cannot access protected member declared in class ‘FTransform’ | MyGame | C:\MyGame\Source\MyGame\C\_Utils\MyUtils.cpp | 12 | |

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:20pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/27 "2022-08-15T18:20:31Z")

</div>

Yea that function has a lock on it then, you can see in unreal doc pages what functions are locked and cannot be used in cpp, you can use only in blue prints.  
So they did this to limit access to flawed output maybe and left it for blue prints with a conversion library. Could be that, anyway you can’t access restricted functions and classes from C++ in unreal if they are locked.

Your only solution is to convert to an int.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:22pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/28 "2022-08-15T18:22:43Z")

</div>

lets try, how to convert it to an int? my brain is just melting, already second day trying to fix this

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:24pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/29 "2022-08-15T18:24:38Z")

</div>

I never did this with Ftransform, only with Fvectors.  
You have to catch the index with the operator []  
declare an int first or the array is type int for indexing.  
When you add the possition or possitions to the vector, in your case the FTransform you have to catch the index []

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:27pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/30 "2022-08-15T18:27:12Z")

</div>

ok, and can I use blueprint library for this particular function? or it will also not work in C++?

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:29pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/31 "2022-08-15T18:29:20Z")

</div>

You can also do this  
int a4;  
int a4 = floatpoints Add(FVector x,yz blah blah blah

So it adds the vertices and at the same time creates an int for it.  
This is a conversion method.  
In this case floatpoints is your array of floats.

I don’t know if it works with ftransform. Works for vectors. But ftransform is made out of vector data. If it works reply, currious if it works like this.

So convert and obtain a integer and use that to compare the indexes of the ints. You have to create int indexes for all your values.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:33pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/32 "2022-08-15T18:33:13Z")

</div>

Ok I will now try this solution.  
and to explain more what I am doing , this image will explain all.

Currently I am at the `Random Display Location` a problem 😃 point and very closer to finish it…  
everything else working just perfectly.

 ![image_2022-08-03_210458046](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/4/cf40d88d9b3d2063eee74412e2282224460f6ff6.png)

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:34pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/33 "2022-08-15T18:34:54Z")

</div>

You don’t have to copy the a4 as an example, you can name your int how ever you want or your array of floats.

I transform data from local to world not to get distortions out of place when I’m using relative possitions I covert back and forth, so if it works please post a replly I may want to use this too.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 6:36pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/34 "2022-08-15T18:36:37Z")

</div>

I will post it for sure, even if not works I will post.  
lets see what we will get , hope everything will work fine 🙂

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 6:52pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/35 "2022-08-15T18:52:05Z")

</div>

You can also try to capture it inside the vertice array.  
Your float Vertices[int index] = FVector

But you have to have a function to calculate the grid line if this is what you have and return values with a function.

return x + y , you declare them inside the function as params.  
The values then are loaded into an int type of array, then used with [capture] to load it into the other array.

int index = Your\_return\_function(x, y);

> **[Lambdas: From C++11 to C++20, Part 1](https://www.cppstories.com/2019/02/lambdas-story-part1/)**
>
> Lambda expressions are one of the most powerful additions to C++11, and they continue to evolve with each new C++ language standard. In this article, we’ll go through history and see the evolution of this crucial part of modern C++.
> The second part...

### Captures

The `[]` does not only introduce the lambda but also holds a list of captured variables. It’s called “capture clause”.

So it captures int values to store them with floating points, it creates int indexes. You may pull data after that from the array and compare it with ==

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 7:03pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/36 "2022-08-15T19:03:32Z")

</div>

I am unable to produce a working code in C++, can you make a working example of this logic with same name prefix? so I can exactly try if it will try.

 ![image_2022-08-15_042015387](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/c/3ac2f8bfc53e6dcea35c0201df908c5fc377f317.png)

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 7:05pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/37 "2022-08-15T19:05:18Z")

</div>

I don’t write code for people, this is just for helping out with the stuff you have.  
I have to get into it and it’s time consuming. You should try that, there are plenty of ways to convert or add int to vectors

> **[how to append one vector to another c++ - Code Examples & Solutions](https://www.grepper.com/answers/18768/how+to+append+one+vector+to+another+c%2B%2B)**
>
> vector a;
> vector b;
> // Appending the integers of b to the end of a 
> a.insert(a.end(), b.begin(), b.end());

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 7:08pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/38 "2022-08-15T19:08:27Z")

</div>

I don’t say to get into it, I just don’t know which variable to convert in which.  
I tried your solution and it gives me infinite loop, it mean I don’t convert it properly .  
this is why I asked to show me at least a small example of this logic, the rest I will go my own

---

<div class="post-metadata">

**Author:** ![GigiK-K-K](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GigiK-K-K](https://forums.unrealengine.com/u/GigiK-K-K)\
**Post date:** [August 15, 2022, 7:12pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/39 "2022-08-15T19:12:54Z")

</div>

Transform (name of variable ) is the array, it acts as a variable.

So ```  
Location\_

```auto

Is ? what. a simple float variable, an Ftransform, where did you get this value from.

So this value, 

Location

What type is it ? is it a fvector, a simple float variable a transform type ?
```

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [August 15, 2022, 7:15pm UTC](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457/40 "2022-08-15T19:15:54Z")

</div>

Location is `FTransform` a returning value of random location function

[Previous page](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457.md?page=1)

[Next page](https://forums.unrealengine.com/t/binary-no-operator-found-ftransform-ftransform/628457.md?page=3)
