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"

Don't delete mesh.

Hi. I had a little problem. When I calling DestroyActor () (also I tried Destroy and Destroycomponent()), it doesnt delete WeaponMesh. BlueprintClass inherited by AMyWeapon, difference just because in BlueprintClass chosen WeaponMesh. Do you know how I can solve this problem?alt text (In the second screenshot Create CurrentWeapon)

Product Version: UE 4.11
Tags:
code1 .png (876.6 kB)
code4.png (817.7 kB)
more ▼

asked Jul 27 '16 at 12:02 PM in C++ Programming

avatar image

antontursky
1 1 1

avatar image Digi Labs Dan Jul 27 '16 at 03:13 PM

What is WeaponMesh1P? I can only see the beginning of the type - is it a USkeletalMeshCompnent or a USkeletalMesh?

avatar image antontursky Jul 27 '16 at 05:02 PM

WeaponMesh1P is it USkeletalMeshComponemt, which was created in c++, and mesh was loaded in BlueprintClass.

avatar image Digi Labs Dan Jul 27 '16 at 06:03 PM

Let's see the code that created WeaponMesh1P.

avatar image antontursky Jul 28 '16 at 07:43 AM
 WeaponMesh1P = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("WeaponMesh1P"));

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

1 answer: sort voted first

I think the proper answer is that you shouldn't have to totally destroy it. DestroyActor has already marked the SkeletalMeshComponent for destruction and it will be cleaned up totally the next time the Garbage Collector runs.

Here's a good discussion about what happens when you Destroy an actor: https://answers.unrealengine.com/questions/3953/question-how-to-destroy-an-actor-properly-in-c.html

more ▼

answered Jul 28 '16 at 05:01 PM

avatar image

Digi Labs Dan
571 16 12 34

(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