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"

AttachRootComponentToActor access violation when opening project directly through the editor

I'm currently working on a project using Unreal v4.10 preview 4.

When opening the project directly via the editor, I am hit with an access violation on this line when I attempt to play:

 _tile->AttachRootComponentToActor(_main, NAME_None, EAttachLocation::KeepWorldPosition);

However, frustratingly, I cannot debug or evaluate which part of the line of code is causing this issue, as running the project from Visual Studio (build configuration is DebugGame) or attempting to debug it does not re-produce this error and the game loads just fine. Does anyone know why the game can run from VS or be debugged, but crash when opening the project from the editor? Is this a bug? It is the first time I have encountered this issue so perhaps it is something caused by preview 4? The line is pratically unchanged althroughout development, starting from v4.9.1.

EDIT:

I have adjusted the line to this:

 if (_tile)
 {
     if (_main)
         _tile->AttachRootComponentToActor(_main, NAME_None, EAttachLocation::KeepWorldPosition);
     else Helper::DebugFStringLog("_MAIN IS NULL: " + _tilePos.ToString());
 }
 else Helper::DebugFStringLog("TILE VARIABLE IS NULL: " + _tilePos.ToString());


It seems the '_main' variable is null. Which is wierd, as, again, _main is initialised if I run the project from VS, and I can see in the world hierarchy window that the level tiles are parented to the '_main' object.

_main is an actor child class I called "AEmptyActor." I spawn this first before anything else is created and attach the level tiles to it. It essentially acts as a dummy object I can attach things to.

Product Version: UE 4.10 Preview
Tags:
more ▼

asked Nov 06 '15 at 10:40 PM in C++ Programming

avatar image

jamiewhitephd
48 6 13 17

avatar image jamiewhitephd Nov 08 '15 at 12:27 PM

... anyone?

(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