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"

How can I cast from an actor to an actor component class?

I'm trying to cast my character BP to an actor component class but it's not able to inherit from it because they don't share a parent class, I assume. Is there any way to do this so I can get variables from the character BP? I'm trying to get a bool from a widget, and I was somehow able to create the widget ui in the actor component, and it recognizes the variables in the widget, but it doesn't detect changes in their values.

I have currently tried casting to the actor component, only getting invalid inheritance messages, and getting all actors of the character class returns none in the editor. Pictures can be provided if needed.

Product Version: UE 4.21
Tags:
more ▼

asked Feb 10 '19 at 04:02 AM in Blueprint Scripting

avatar image

Daedonis
8 1 2

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

1 answer: sort voted first

Does the widget need the characters variable information or the actor class or the component?

There are a few different ways, but would need to know more info such including if there are any events or overlaps firing off before needing this info var info...

Here is the simplest, but maybe the least efficient method.

alt text

more ▼

answered Feb 10 '19 at 06:50 AM

avatar image

Kmontoya
51 2 5

avatar image Daedonis Feb 10 '19 at 08:26 PM

Well, I'm trying to get an event boolean for a checkbox variable on the widget. (It's for a character creator) So I really only need to get it from the widget to the actor component, but it's not recognizing variable changes from it when I create the widget in the actor component, but it does when its created in the FirstPersonBP. Checkbox

Getting Widget in ActorCmpnt

The component is attached to the FirstPersonBP to represent party members that can be added/removed easily. And casting to the component does nothing since it doesnt inherit. I just need the component to recognize that the bool on the checkbox widget is changed

(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