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"

Unable to destroy actor

Hi all,

So I have this simple script: alt text

The array contains actors; The actors are all from the same (blueprint) class. It's just a few in the scene.

The blueprint class is called Blueprint_CellWall. The array is set to be editable, and exposed on spawn, so I set its contents from withing the editor window. Here's another pic from the editor:

alt text

Does anyone know why I can't manipulate it? If I print out their locations, it does it correctly...

I also get an error when I replace the destroy actor with a move actor node:

alt text

Product Version: Not Selected
capture.png (108.0 kB)
capture.png (155.0 kB)
capture.png (7.8 kB)
more ▼

asked Feb 21 '15 at 10:38 PM in Blueprint Scripting

avatar image

444 99 84 108

avatar image mpie Feb 22 '15 at 07:52 PM

Is no actor destroyed or only one? I believe the timeline is run only once, not for every array item once.

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

2 answers: sort voted first

I reproduced your error. Gotta be honest, I'm not 100% sure why it wasn't deleting, but I tried a different approach and got it to work. First, forLoops keep shooting even if the first iteration hit a delay or timeline, so you probably don't want that. Because a timeline can be used like a tick event that you can turn on and off, just keep checking the length of your array to see if it is 0. If it is, stop the looping timeline. (I put a delay on mine, I don't know if you wanted a pause in between each one or not)

alt text

Make sure you remove the index of whatever you had just deleted. If you don't it will only delete one and loop forever.

I was only using M pressed for testing.

more ▼

answered Feb 23 '15 at 02:19 PM

avatar image

214 12 11 26

avatar image ShrewGlue Feb 24 '15 at 12:45 AM

So the code below contains what I need?

avatar image Maverinox Feb 24 '15 at 02:15 AM

The code below does what you seem to be trying to do. I don't know all of your code. The code I provided shows how to delete multiple actors using a timeline.The order in which they are deleted would be decided by the order you add the actors to the array. Any changes are of course up to you. I've commented the differences I have made.

tl;dr, yea

capture.png (129.1 kB)
avatar image ShrewGlue Feb 24 '15 at 02:34 AM

Haha, thanks so much! You're really helping me out! Do you know what I could do if instead of destroying the actor, I wanted to add actor world offset (where the delta value is driven by the timeline?)

Something like this maybe, but that actually works? alt text

capture.png (129.1 kB)
avatar image Maverinox Feb 24 '15 at 04:01 AM

Well, if you do it like that, it's just gonna keep adding offset forever unless you limit it. This is kinda how it'd be: alt text

It'd be better probably to use lerp and set actor location, such as: alt text

This would do it one at a time, however, and doesn't use the timeline value (that didn't work for me). If you want to do it all at once you could make a function attached to the timeline that does all of that for each one. basically copy most of it, make a function out of it, and the inputs would be the actor from each index of the array.

If this answers your question, mark it as accepted after you try it out c;

avatar image ShrewGlue Feb 26 '15 at 01:20 AM

Thanks for all your help, It doesn't seem to be moving :\ When the code runs the items in the array wont't move and so the if statement checking if the actor location is equal to the moveToLocation never becomes true.

alt text

EDIT: Forgot to mention, if you set the target for the move actor node to the self (AKA the blueprint that's running with, it does work, and moves itself)

capture.png (164.6 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The best way to troubleshoot your issue would be to use "Breakpoints" to find what part of the code is firing and what isn't. What I would do is attach a "Print String" to the "Is Not Valid" to see if that's being fired.

I also notice that your "DoOnce" isn't resetting, so it's literally only ever firing once, But I haven't had much experience with the "DoOnce" node.

Check out this documentation: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/Debugging/index.html to find out where your code is firing.

more ▼

answered Feb 22 '15 at 07:38 PM

avatar image

2.3k 98 84 398

avatar image ShrewGlue Feb 22 '15 at 09:29 PM

It is valid: I've added a print string, and printed the location of both the items in the array. But they're not being deleted :\

(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