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"

Break off a single chunk from a destructible mesh

I am trying to break off chunks one at a time in a very clean way. Lets say you were doing an retro astroids game and when a bullet hits the asteroid you want ONE chunk to fly off while the remaining chunks staying perfectly intact. No variability in how it behaves...

So far I have tried the following, trying to be very specific with damaging particular chunks:

 nvidia::apex::DestructibleActor* ApexActor = DestructibleComponent->ApexDestructibleActor;
 int32 chunkIndex = DestructibleComponent->ChunkInfos[x].ChunkIndex;
 physx::PxBounds3 ChunkT = ApexActor->getChunkBounds(chunkIndex);
 ApexActor->applyDamage(1, 2000, ChunkT.getCenter(), PxVec3(0, 0, 1), chunkIndex);

But it does not behave how I want. I expect it to apply damage to ONE chunk, and everything else is undamaged and sticks together... but it is very inconsistent and seems to apply damage to multiple chunks. I have been stuck on this issue for a few days and Im about to abandon it entirely because of how long its taking (which is frustrating because I think should be relatively simple...)

As far as my destructible mesh asset goes, I have a support depth of 1 and a damage spread of 0. Ive read that support depth of 1 is what you want when you dont want it to completely break after being damaged, but I don't really understand what it is or what its doing. So if anyone could explain support depths, that might help as well. If I have to use PhysXLab I am willing to do that, though I'd rather not because the tutorials and documentation seem a bit iffy.

I may actually just store the locations of each chunk and manually set their locations in tick such that they stay in their proper spot until I damage them, but this seems super hacky and not ideal at all!! Any help appreciated!

Product Version: UE 4.15
Tags:
more ▼

asked May 14 '17 at 03:21 AM in Everything Else

avatar image

Missing A Few Heads
6 1 4

avatar image Missing A Few Heads May 14 '17 at 10:39 PM

So I resorted to manually setting the position of chunks so they are locked in place... however the chunks dont get updated immediately. Theres like a full second delay before their positions get set. Im guessing theres something I need to do to make it update immediately (markTransformDirty? I dont know what it would be called. whatever forces it to update the position i have given it)

(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