Hi :rolleyes:
How can I do the following condition in blueprint:
if object1 position equal object 2 position then do something
Hi :rolleyes:
How can I do the following condition in blueprint:
if object1 position equal object 2 position then do something
You must get a reference of each of these two objects and, from the node “Get Actor Location”, compare if these two vectors are equal.
To get these references, you can try get all actors of class (this can be very expensive for performance if called in a tick, for example) or try storing those two objects references in your BP class at the begin play.
You probably want to use an in range check too since it’s unlikely they will match up in the exact same position.
Easier way is just to use an overlap on them though with an event on 1 of the objects when the overlap happens.
“location of object A” - “location of object B”, get “vector length” of it.
Now that vector length is distance between objects.
If its less than for eg. 10 those objects are almost in same place
You can use overlap event to check if they are overlapping, then continue testing if objects are close enough.
bit more detailed stuff:
I need also something like that. i have a object and the player in vr must overlap this object with another object like a lego. it should be learn application how you can build a complete object from many other objects. Here is my post : https://forums.unrealengine.com/development-discussion/vr-ar-development/1488583-pick-up-a-object-and-connect-with-a-second-object-if-i-touch-the-secon-object