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"

Object error when casting to enemy character BP

Hi guys probably an obvious mistake with my graph here but I need to cast to my enemy character BP to play some animations and stop movement in a different blueprint. Got a screenshot showing the cast and the error when compiling. If you need more info to help me just ask. Appreciate any help Thanks. alt text

Product Version: UE 4.9
code4.jpg (170.5 kB)
more ▼

asked Jun 03 '16 at 03:02 AM in Blueprint Scripting

avatar image

The Slayers Roar
7 4 5 6

avatar image Nachtmahr Jun 03 '16 at 03:10 AM

Uhm where is the Screenshot?

avatar image The Slayers Roar Jun 03 '16 at 03:13 AM

Oh oops just turned off pc to go to sleep appreciate your interest will put the screenshot up when I wake up

avatar image D3ATH95 Jun 03 '16 at 03:08 PM

Mind if I see the whole code? If I think I see what you are trying to I'll show you a better solution.

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

1 answer: sort voted first

You got the Concept of a Cast wrong, a Cast wont get you something out of thin air.

A Cast simply takes a Object and Cast it to a Specific Type. Like you can have a Variable that Holds a Controller or anything that is a Child of Controller, but your BP only knows its a Controller and not if its a AIController or PlayerController or any other Controller Type. But if you take that Controller refference and Cast it you basicly asking is this Controller Refference a AI Controller. If Cast is a success it is indeed a AI Controller und you can access all public variables and Functions it has.

In your example you probably have already somewhere a Pawn ref earlier in the graph you can get the the Controller from there and put it in the Object Pin of your Cast.

I Highly recommand you to watch this Training Video to get the Basics down https://www.youtube.com/watch?v=EM_HYqQdToE

Good Luck and have Fun =)

more ▼

answered Jun 03 '16 at 06:14 PM

avatar image

7k 143 28 172

avatar image The Slayers Roar Jun 07 '16 at 10:15 PM

Hi guys thanks for the help managed to find another solution to the issue.

avatar image Nachtmahr Jun 07 '16 at 10:26 PM

You´re welcome? Even though there is just one Solution for the Cast xD stick in a Target.

Otherwise you just changed how you get your desired Refference. Thats fine too.

(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