Announcement

Collapse
No announcement yet.

Compare two objects position

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    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/deve...e-secon-object

    Leave a comment:


  • replied
    "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:
    - in overlap event, get all actors that overlap and are of class you want to check, this will make an array
    - in end overlap update that array again, so you keep list of overlapping actors only. Basically begin overlap and end overlap should have almost same code.
    - having that array on event tick check distance to all actors (like described above), if any of them is closer that some snapping distance that means both are places in same location.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • started a topic Compare two objects position

    Compare two objects position

    Hi
    How can I do the following condition in blueprint:

    if object1 position equal object 2 position then do something
Working...
X