x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

selecting an actor by intersecting 2 objects

I'm trying to figure out is the best way to select an object with 2 intersecting bars of color. I'm going to have the player drag a color bar vertically down a 4x4 grid of spheres choosing any of the 4 rows. Then they drag another bar of the same color to the right choosing any of the columns. where the 2 bars color intersect will be the sphere that is chosen eliminating the other spheres in the rows and columns the bars reside in. The selection has to be made at the intersection of the 2 color bars not where the cursor/finger will be. Any help would be amazing! alt text

Product Version: UE 4.21
Tags:
puzzle-sb.jpg (325.6 kB)
more ▼

asked Feb 14 '19 at 07:55 PM in Blueprint Scripting

avatar image

Urbachd
1 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

the idea that spring to mind for me is overlaps, basically do a check for each sphere where it checks is this sphere overlapping both bars.

im assuming that you have some method which selects the bars for movement then deselects them when needed. in this case you would have a event that fires when a bar is deselected which will be the initiation of the check. the check itself is just a for each loop on a array containing the sphere actors. the for each will execute a get overlapping actors and compare that array to the two bars. we then use the results as well as a "and node" to determine the state of a branch. from there you just execute what you like (set that actor to a variable, destroy it, whatever).

alt text

capture.png (282.9 kB)
more ▼

answered Feb 14 '19 at 11:14 PM

avatar image

ThompsonN13
10.1k 33 9 23

avatar image ThompsonN13 Feb 14 '19 at 11:17 PM

or you could just get a location based on the bars locations, so the X of the horizontal bar and the Y of the vertical one. combine those and you get a location, then you just find the sphere in that location.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question