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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Select Actor Via/On Click

![

Hi!

I already have an Actor-Selector set up, altough it is wired to the keys 1,2 and 3. Since the target platform is a tablet , these numbers need to be changed to Touch (Or Click). The Idea is that when clicking one of the possible three actors (RotationCharacter1 through 3) the game posses this new actor. The image shows what i have right now.

I have tried to use mouse over + click, although i didn't get it to work at all, and neither has hit under channel (The reason being that i didn't see a way to convert hit to actor reference).

The Solution:Thanks to vanlacke

Product Version: Not Selected
Tags:
namnlös.png (213.8 kB)
more ▼

asked Apr 08 '15 at 08:34 PM in Blueprint Scripting

avatar image

TheSwarre
10 2 3 9

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Possibly the reason your previous try at mouse over + click didn't work is because your collision was wrong, "Visibility".

Try changing that.

Also, to convert hit actor reference, just cast to your pawn BP

alt text

(also, would be best to not get cursor hit every tick, just put that part on left click)

possess.png (125.2 kB)
more ▼

answered Apr 08 '15 at 08:57 PM

avatar image

vanlacke
1.5k 65 132 103

avatar image TheSwarre Apr 08 '15 at 09:11 PM

Well, everything set up but the Get Hit Result Under Cursor by Channel only has two values, no hit result hit actor. How do i set up one with more options?

avatar image vanlacke Apr 08 '15 at 09:17 PM

Two ways: Drag out Hit Result and "break hit result", or, right click on Hit Result and split struct pin

avatar image TheSwarre Apr 08 '15 at 09:24 PM

That worked, though one final thing, my "Set" of pawn to posses looks like in the attached image, so it is the wrong type. Which type should i use?

alt text

namnlös.png (13.4 kB)
avatar image vanlacke Apr 08 '15 at 09:25 PM

The variable type should just be actor

avatar image TheSwarre Apr 08 '15 at 09:40 PM

This Is how it looks now, sadly, it doesn't seem to work, nothing happens when clicking :(

namnlös.png (210.1 kB)
avatar image vanlacke Apr 08 '15 at 09:57 PM

?

did it work?

avatar image TheSwarre Apr 08 '15 at 10:00 PM

Looks like this text didn't make it:

"This Is how it looks now, sadly, it doesn't seem to work, nothing happens when clicking :("

avatar image vanlacke Apr 08 '15 at 10:12 PM

Try changing "left click" to "e" or something. See what happens.

If that doesn't work, use "enable input".

Is this top-down project?

avatar image TheSwarre Apr 08 '15 at 10:20 PM

"Try changing "left click" to "e" or something. See what happens."

This Worked!! Very, Very nice. Thanks a lot for this!

(comments are locked)
10|2000 characters needed characters left

PlayerController has a "Get Hit Result Under Cursor for Objects", you can pass it an array of acceptable object types (like Pawn) and then use the "Hit Result" to get the clicked on pawn.

Hope it helps :)

more ▼

answered Apr 08 '15 at 08:52 PM

avatar image

Justin.Dooley
2.1k 104 70 160

avatar image TheSwarre Apr 08 '15 at 09:17 PM

With the risk of sounding dumbfounded, what kind of variable should i use? I can't find a "Hit Result" for the normal pawn-variable.

(comments are locked)
10|2000 characters needed characters left
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