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"

Destroy mesh on command

I'm sorry if this is something fairly simple but I have a box that I want to destroy when my weapon hits it and when it gets in the radius of a bomb (a blueprint using a RadialForce component). I'm at a point where I can destroy the box when the weapon hits it (I simply check if the actor colliding is my weapon blueprint and then apply radius damage to it) but it also gets destroyed when my character walks into it and I don't want that to happen. It may just be a problem in the destructible mesh's settings but I'd be grateful if someone could help me. Thank you!

Product Version: Not Selected
Tags:
more ▼

asked Mar 13 '15 at 07:34 PM in Blueprint Scripting

avatar image

EliasPa
89 22 22 23

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

1 answer: sort voted first

Add a check for who is the instigator and check if it's your character , you could also do it like this, onEvent ->instigator->getPlayerController->IsValid, if you get a valid return than the instigator is your character so don't destroy on true. alt text

screenshot381.jpg (99.5 kB)
more ▼

answered Mar 13 '15 at 08:05 PM

avatar image

Jurif
627 26 15 45

avatar image EliasPa Mar 13 '15 at 08:34 PM

I don't know if that's my problem exactly but thanks for answering!. Here's what happens when my player hits the box, it just kinda fractures it:alt text

And here's what happens when my weapon hits italt text

And here's my blueprint for handling it:alt text

Here are my settings for the destructible, there might just be a problem with these:alt text

box.png (82.3 kB)
box2.png (136.0 kB)
destroybp.png (96.9 kB)
settings.png (48.6 kB)
avatar image Jurif Mar 13 '15 at 08:45 PM

Oh, I see now, well I assume the blueprint you posted is the Box destructible blueprint? If so just add a check like I suggested after the event is triggered. And then connect the "False" to your CastToBoomerangProjectile node. Also want to point out you're not doing anything with this node, you'd need to use "As Boomerang Projectile BP" pin and drag out of it and you get access to it's content. So in this case seems like you don't need the cast.

avatar image EliasPa Mar 13 '15 at 09:03 PM

It doesn't seem to work but it seems that my character triggers the destroying of the mesh regardless of the blueprint, just a regular collision. So I think there must be something wrong with the settings. If there was a way for the mesh just to ignore my character's collisions. Do you happen to know anything about those?:P

avatar image EliasPa Mar 13 '15 at 09:09 PM

Oops thanks for pointing that out, it just looked like it was working, I guess I'm back to square one then:P

avatar image Jurif Mar 13 '15 at 09:52 PM

Well depends on what you want to do, I haven't done any destructibles , so not sure if you could set this up in there, probably not, one simple way would be to just turn off collision on your character, but that's not good.

If you still want to have a box bounce when the character collides with it you'd need to have a non destructible mesh for that with physics enabled, and only when the boomerang projectile would hit the box, then you would first get and save box location into a variable, then destroy the box, and spawn another destructible box in same position, and of course then apply the Damage so it explodes. So first make a non Destructible physics box , that would be my suggestion, let me know ...

avatar image EliasPa Mar 13 '15 at 10:02 PM

Yea that seems like something i could try. As my previous attempt to check if the actor that hits the box is my boomerang failed, do you know how i could check that?

avatar image Jurif Mar 13 '15 at 10:13 PM

I would set that up in the boomerang projectile, onEvent-> check if instigator(Other Actor) is a non Destructible box BP, if it is, then GetBoxLocation->Destroy(Box)->SpawnActor(DestructibleBoxBP)->ApplyDamage . Just take it slow, and report back when stuck, I'll be online for few more hours, then I can help you tomorrow ...

avatar image EliasPa Mar 13 '15 at 10:43 PM

That works more than well thank you! Here's my destructible BP:alt text

Here's the boomerang projectile BP:alt text

It works really well but I'm not so sure about the rotation of the spawned destructible, it really doesn't matter since it gets destroyed immediately but do you know if that gets the real rotation of the non destructible mesh or just something else entirely?

boomerangbp.png (179.9 kB)
avatar image Jurif Mar 13 '15 at 10:49 PM

Congrats :D, nice work, well thought, instead of getting the actor location, try getting "Actor Transform" directly.

avatar image EliasPa Mar 13 '15 at 10:54 PM

Yup that did it thanks!:P

(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