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't destroy or hide from c++

Hello everyone :)

I'm trying to make my player put an item back in his bag (by destroying or hidding it, it doesn't matter for now). I've tried to call different functions on it : Destroy(), K2_Destroy(), SetActorHiddenInGame(), SetHiddenInGame() on each components or DestroyComponent()

None of this worked. I've checked that my pointer is not null, and that my function is called and it was called in all of my attempts even if I saw no effect.

So I try using a blueprintnativeevent to call hide() or destroy() and put a print after the call to be sure it was called. It was but my actor was still seen by the player. BUT when I changed the blueprintnativeevent from BeginPlay of BP it worked ! So it seems like I use the good function in the good way but as soon as there is c++ involved... it does nothing.

It seems like a weird issue and I have no idea what I could be doing wrong. Does someone have the solution to this ? Or at least encountered the same issue ?

Thanks for your answers :)

Product Version: Not Selected
Tags:
more ▼

asked Dec 13 '14 at 11:59 PM in C++ Programming

avatar image

Adinimys
73 10 7 13

avatar image eXi Dec 14 '14 at 01:11 AM

Hey, if it's ok, please share the c++ code that belongs to the error. If the Class is not very big, please share the whole cpp and header file. That's the easiest way to see what is going wrong.

avatar image Manspear Sep 03 '17 at 11:25 AM

I have the same problem. A class I've got spawns an actor, and after a while calls the actor's Destroy()-event. Nothing happens though.

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

1 answer: sort voted first

I found that it was due to the fact that I was using TSubclassOf to call my function. When using pointers*, it is working properly. I don't totally understand on what the function was called before, but the problem is solved.

Thank you :)

more ▼

answered Dec 15 '14 at 01:36 PM

avatar image

Adinimys
73 10 7 13

(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