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"

GetCapsuleComponent uses an invalid target

I want my Player Controller to do the following: when left clicking on actor TriggerBox, if it overlaps with pawn CameraPlayer, deactivate collision. But when I try to compile, I get the following error:

alt text

Product Version: UE 4.16
Tags:
more ▼

asked Jul 17 '17 at 09:20 AM in Blueprint Scripting

InfiltratorN7 gravatar image

InfiltratorN7
7 1 3 3

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

3 answers: sort voted first

Cast node always need an input object. This object will be casted to your class.. If this is PlayerController BluePrint and your default or possessed pawn is Camera player, try GetControlledPawn node because get controlled pawn node will give back the actuall possessed pawn :)

From that maybe you can cast and use your other code. (And dont forget cast nodes always need execution pin too "white line")

more ▼

answered Jul 17 '17 at 09:30 AM

AmphDev gravatar image

AmphDev
481 12 3 28

InfiltratorN7 gravatar image InfiltratorN7 Jul 17 '17 at 03:19 PM

Ok, I think I understand now. I thought a cast node could act as a reference (like in a level blueprint), so I didn't think it needed an input object and to be executed.

Unfortunately, your solution doesn't work, because I need a way to reference ALL CameraPlayer pawns in the level, not just the one being controlled by the player. Any ideas how I could do this?

Edit: Perhaps I should try a more simple approach. Instead of having the actor disable collision only when overlapped by a certain pawn, it should do so when overlapped by anything at all. That would still work for me. Something like this:

alt text

When cursor is over actor TriggerBox, if the actor is overlapped by anything, deactivate collision. Could this work?

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

Read the message again.

The Cast To Node is not executed (The Arrow Pins are not connected)

more ▼

answered Jul 17 '17 at 09:30 AM

Raildex_ gravatar image

Raildex_
302 9 13 33

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

I think you need to re-think your code, if the idea is that you want to know if any camera is overlaped.

There is a method for collisions that will returrn all of the overlapped componets, don´t use a trigger for this, trigger is just to turn on and off, I think you should use a collision box.

When the collision is overlapped, you could ask for the method "getOverlappingActors" or "getOverlappingComponents" (the last will provide exactly the component (camera) that is overlapping, actors will return a type (like your FirstPlayerBlueprint).

With that method, latter you could create a foreach, filter by type and do whatever you need...

Hope it helps

more ▼

answered Jul 17 '17 at 04:11 PM

leofucci gravatar image

leofucci
40 2 2 5

InfiltratorN7 gravatar image InfiltratorN7 Jul 17 '17 at 04:54 PM

"I think you need to re-think your code, if the idea is that you want to know if any camera is overlaped."

Please ignore the names of my actor and pawn; I'll have to rename them eventually. The pawn is a playable character, and the actor is just a static mesh. The idea is that if the pawn overlaps the actor, the actor deactivates collision until the pawn has moved away and is no longer overlapping.

(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