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"

Help me on Instigator issue

Hello everyone, I was following the Weapon essentials tutorial, and at one point it does a similar function with this ...

void AWeapon::SetOwningPawn(AWeaponEssentialsCharacter * NewOwner)

{

 if (MyPawn != NewOwner)
 {
     Instigator = NewOwner;
     MyPawn = NewOwner;
 }

}

and as I was following the tutorial I tried to do the same but in my case it returns error, the image I'm going to leave is in Portuguese(sorry for that)alt text ,

but it says: a value of type "AFSCharacter* " (my base character) can not be attributed to a "APawn " type of entity, I did not know what it was and I checked on some of the codes that exist in the community (Shootergame and Survival Game) and both make that mention (by the way I understand it's a conversion) , but in my compilation conversion does not happen. Could someone help me with this? And in another doubt I'm a beginner in C ++ in the unreal engine, and I wanted to know a lot how I could expose my booleans to Anim BP;

Product Version: UE 4.20
Tags:
sem-titulo.png (79.2 kB)
more ▼

asked Nov 03 '18 at 03:26 PM in C++ Programming

avatar image

yDanTe.
5 1 3

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

1 answer: sort voted first

It looks like instigator is of type AFSCharacter and NewOwner is of type APawn. It's basicly telling you that the two types are not compatible (it does not know how to convert the two), so you have to cast APawn to AFSCharacter like this:

 Instigator = cast<AFSCharacter>(NewOwner);
more ▼

answered Nov 03 '18 at 06:08 PM

avatar image

Steve SybrSyn
1.5k 4 5 10

(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