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"

4.8.3 Is there meant to be a difference between using arrays within Functions vs Events?

I came across as situation where I was attempting to take an array and remove an item at index. When the array was referenced from the same blueprint, it worked correctly, but if the array came from an input into the method, the array would not be altered. However, it works with functions. I am wondering if this is intentional, and if so, can someone explain to me why?

Here are some images that might help explain it better. I made this in a fresh project.

With the first image, the values in the array remain unchanged.

alt text

With this one, it works as intended, removing all of the values from the array. alt text

Here is how I have a function set up and working the way I wanted the event to in the first image. alt text

alt text

Product Version: UE 4.8
more ▼

asked Aug 03 '15 at 03:23 PM in Blueprint Scripting

avatar image

1 1 2

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

1 answer: sort voted first


why not just use "remove index" right after tick even?

more ▼

answered Aug 03 '15 at 05:37 PM

avatar image

576 54 46 72

avatar image Faelinor Aug 03 '15 at 05:42 PM

This wasn't the exact situation I was using it, there were other factors involved and I wasn't using it after event tick. I just did it this way in the example because it was a simple way to display what I was trying to do. Regardless if it's not best practice, I'm curious as to whether it ShOULD work.

avatar image happyhorror Aug 03 '15 at 08:00 PM

i did some investigation of custom event and function with same code inside and here are result:

function - "remove index" inside work properly, printing array length inside function and outside gives same number

custom event - "remove index" inside have no effect on array length inside and outside, but! "resize" inside custom event work really weird, it change arrays size and print correct value, but at same time tick event print same unchanged size of array, screenshots for clarifocation

https://yadi.sk/i/P6WAIzpRiFUin https://yadi.sk/i/z0LNYbOjiFUwP https://yadi.sk/i/7DKfhTwKiFVu2 https://yadi.sk/i/V9v9Ds00iFWaC

(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