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"

C++ Failed to create an instance

Ue4 crashes when i try to create an instance (AMonster_Spawner ms), i simply try to access TArray in the gamemode Vechten class from the Monster_Spanwer class

thanks

 class MYPROJECT_API AMonster_Spawner : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     AMonster_Spawner();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
     UPROPERTY(EditAnywhere)
     TSubclassOf<AMonster_object> mesh;
     TArray<AMonster_object*> AMonster_Spawner::monster_lijst;
     int time;
     FVector loc;
     
 };

 class MYPROJECT_API AVechten : public AGameMode
 {
     GENERATED_BODY()
     public:
         void AVechten::BeginPlay();
         void AVechten::Tick(float DeltaTime);
         AMonster_Spawner ms;
 };


Product Version: UE 4.11
Tags:
more ▼

asked Jun 05 '16 at 02:27 PM in C++ Programming

avatar image

jeremiah8100
1 1 2

avatar image Shadowriver Jun 05 '16 at 06:02 PM

You checked what showing up in logs (go to Saved/Logs in project directory)?

avatar image jeremiah8100 Jun 05 '16 at 07:18 PM

yes: Fatal error: [File:D:\BuildFarm\buildmachine_++UE4+Release-4.11\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2239] UObject() constructor called but it's not the object that's currently being constructed with NewObject. Maybe you trying to construct it on the stack which is not supported

avatar image jeremiah8100 Jun 05 '16 at 07:22 PM

But i just try to access an array which is in another class

(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