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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Interacting with custom class within 2d character blueprint?

Child of Paper Character. Can't access functions within my class. Where to include my class? Tried in the parent, no result.

Product Version: UE 4.9
Tags:
more ▼

asked Oct 17 '15 at 04:56 PM in Blueprint Scripting

avatar image

Verrso
3 1 2

avatar image spazchicken Oct 17 '15 at 07:52 PM

Are you asking how to get paper2D to work in your class?

avatar image Verrso Oct 17 '15 at 08:19 PM

I want to call a function in my custom class from that blueprint. So, the other way around, I believe.

avatar image spazchicken Oct 17 '15 at 08:34 PM

oh so you already created something in your blueprint and your wanting to edit it in your class. Or is it a default function/variable from the blueprint?

avatar image Verrso Oct 18 '15 at 09:26 AM

Yes. I have my class with a public function within it, and a basic template blueprint of 2d character. When character overlaps the actor of my class, I want to call a function within that class from character's blueprint.

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

1 answer: sort voted first

Your problem is that you by default only get an "Actor" reference from most functions (aka overlap events, hit events, etc.)

Once you overlap and want to call this function you need to cast the "Other Actor" to your desired class.

Alternatively if you have a few objects which should interact in a similar way (you walk by and something happens) I would strongly suggest using a BluePrint Interface.

Here is two documentation pages on what interfaces are and how to implement them:

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/index.html

https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Types/Interface/UsingInterfaces/index.html

more ▼

answered Oct 18 '15 at 10:41 AM

avatar image

Erasio
5.9k 291 86 293

(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