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"

Can not cast AnimInstance to Interface

alt text

I have the interface shown above defined in C++

alt text

I added the interface to Vm13AnimBlueprint I made in the editor. The interface is listed in animblueprint's "Implemented Interfaces" column. I can also create node events defined in the interface.

alt text

However I am unable to call these events from C++. The cast from the AnimInstance to the Interface always fails. The character variable is always NULL. You can see from the debug popup that the AnimInstance is correctly acquired but the cast is failing.

I've come back to c++ after a very long time maybe I misunderstood something basic? why is this not working?

Product Version: Not Selected
Tags:
more ▼

asked Jan 21 '15 at 03:54 PM in C++ Programming

avatar image

Waves
67 4 7 11

avatar image edsonsantoro Jan 06 '17 at 11:32 AM

ILedgeGrabInterface does not inherit from any class, ULedgeGrabInterface is a UInterface derived class, and your AnimInstance var is an UAnimInstance class.... As far as I know, the Cast method works only for related classes, like UVehicleAnimInstance is a UAnimInstance implementation, so you can cast it.

avatar image Waves Jan 10 '17 at 08:04 AM

This was a long while back.

It seems my issue was that I added the ULedgeGrabInterface to the AnimInstanceBlueprint in the Editor then tried to cast my base AnimInstance class in c++ which is not going to work.

To get this to work I have to add the interface in c++

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

0 answers: sort voted first
Be the first one to answer this question
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