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"

Crash when SetAnimation() is called

Hi, I Updated my project from ue 4.17 to 4.22.1 everything worked fine in the editors viewport when playing the game, but if i start the game in standalone mode or package it it will crash every time after ca 2min, with a access violation error which is caused by SetAnimation(). I use this method to switch between two UAnimationAssets, which works fine but after two minutes it crashs.

link text

Product Version: UE 4.22
unbenannt.png (32.2 kB)
crashcontext.txt (103.5 kB)
more ▼

asked May 12 '19 at 04:17 PM in Bug Reports

avatar image

1 1 1

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

2 answers: sort voted first

Ok thanks for the help i marked both of my UAnimationAssets as UPROPERTY() and now it works. So it really was the garabage collector. But why did it remove those assets in 4.22 and not in the Engine version 4.17, also shouldn't the if (asset != NULL) part return true then?

But still thanks a lot.

crash.png (5.8 kB)
crash-2.png (2.6 kB)
more ▼

answered May 12 '19 at 08:10 PM

avatar image

1 1 1

avatar image Firefly74 May 14 '19 at 09:42 AM

That's how c++ work, the pointer is just an adresse ( and here it has not null ) but when you actually try to reach the object, if it has been replaced by something else or destroy, it throw access violation. Having the uproperty allow 2things, the object won't be garbaged colected automatically, and if the object is destroyed, the property will be set to null.

You also have the "IsValid" macro to check it the pointer is valid before accessing it

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


Looks like a garbage collector related problem.

Could you show the "weaponVisible" variable declaration ? Same for the "weaponConfig", "emptyAnimation" and "shotAnimation"

more ▼

answered May 12 '19 at 06:33 PM

avatar image

1.6k 15 18 34

avatar image SevenOperation May 12 '19 at 06:55 PM

Hi, Seems unlikely the the garabage collector removes it, wouldn't the animation asset be NULL then, also the animations are used all the time.

Photos are attached. Thanks for the help in advance.

weaponvisible.png (17.8 kB)
weaponconfig.png (29.1 kB)
animations.png (9.0 kB)
avatar image Firefly74 May 12 '19 at 07:26 PM

Sorry, i meant the header part ( but you can just confirm that they all are UPROPERTY )

You said access violation, but could you check what variable is null causing thz crash with a debugger ?

I would say it's the "weaponVisible" but as you set it as root component it should'nt change.

(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