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"

Interface Variable type

If you use the "Does Implement Interface" node, you can drag off of the Interface and promote it to a variable. I find this extremely useful being able to plugin the interface being used with a variable. Yet unless I go about this roundabout way I can't seem to find any way of making a variable type of Interface class. The only thing I've found I can do is make Object variables and have them reference child interface classes, but not the parent Interface class, and even those variables aren't able to plugin to the "Does Implement Interface" node so they're useless.

Objects that my player can or can't interact with are on a different interface. It would be useful if I could use a variable for "Does Implement Interface" because I have more than one interface for different types of objects and their child classes.

Product Version: UE 4.20
more ▼

asked Sep 01 '18 at 03:25 AM in Blueprint Scripting

avatar image

1 2 2

avatar image Tuerer Sep 01 '18 at 08:37 AM

Why do you need an interface variable in this case? When you use the Does implement Interface node you can select the interface you need from the drop-down list, as for me it's faster and cleaner than getting the the interface variable and connecting that to interface pin. And even if you have this kind of a variable, it won't help you "tell" your object to activate it, you still have to do it manually.

avatar image CognitiveDesign Sep 10 '18 at 03:32 AM

I have a few different interfaces that just use an Activate call. When I'm putting together a level I'm often changing what I want to interact with and it would be easier if I could just assign the interface in the editor instance. Since they all use the same Activate call, it's simple enough to have a controller the player interacts with which I can change per instance of it, what it should be activating. I've done it with the variable, it works fine calling the different interfaces just from changing the variable on the instance and no changes in blueprint code.

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

1 answer: sort voted first

Not seeing what the issue is here....I created an Interface "Variable" and it seems to work just fine like any other variable.

alt text

more ▼

answered Sep 01 '18 at 07:17 PM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image Tuerer Sep 01 '18 at 07:26 PM

I believe what @CognitiveDesign meant is that you cannot create a variable of this type by clicking +Variable, and that is true indeed. You can only create it by dragging it from the Does Implement Interface node.

avatar image Nebula Games Inc Sep 01 '18 at 07:52 PM

Ahh, I see what you mean. Hmm that is very odd, probably an oversight. I know this was an issue with quaternion variables, some engine versions had them exposed to BP some didn't and sometimes nodes would use the quaternion class and then not be able to create a variable out of it. Weird nonetheless.

avatar image CognitiveDesign Sep 10 '18 at 03:07 AM

It's as Tuerer said. I'm wondering why I can't simply create the variable. I'm not sure if it's an oversight or if it's hidden because you're not supposed to use it, I'd rather not use something in a way it wasn't intended and risk breaking my class. Seems strange you'd need to create a node and then drag off of it to create a variable.

(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