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"

Engine crashing when I press Play

I've started from the Unreal example of flying in c++. I've added some classes to the project, but when I press play the UE Editor crashes even if I remove the newly added classes. I attach the log

link text

Product Version: UE 4.18
Tags:
drone-follower.log (64.2 kB)
more ▼

asked Feb 09 '18 at 09:33 AM in Bug Reports

avatar image

masternick95
1 2 3

avatar image Jeff A ♦♦ STAFF Feb 12 '18 at 03:09 PM

Hello,

We've recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

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

2 answers: sort voted first

I don't see any crash from the log file. Are you sure this is the right one?

more ▼

answered Feb 09 '18 at 03:10 PM

avatar image

vr_marco
2.2k 10 6 12

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

I confused log files, here is the right one: link text

more ▼

answered Feb 09 '18 at 06:09 PM

avatar image

masternick95
1 2 3

avatar image vr_marco Feb 09 '18 at 06:24 PM

Looks like a null pointer exception. Double check/debug these two functions:

[Callstack] 0x00000000C6941FB0 UE4Editor-Drone_follower.dll!AActorsController::ReturnNewData() [c:\users\4r35\documents\unreal projects\drone_follower\source\drone_follower\actorscontroller.cpp:42] [2018.02.09-17.32.43:147][383]LogWindows: Error: [Callstack] 0x00000000C69428D6 UE4Editor-Drone_follower.dll!ABall::Tick() [c:\users\4r35\documents\unreal projects\drone_follower\source\drone_follower\ball.cpp:44]

avatar image masternick95 Feb 09 '18 at 10:49 PM

Yes, but I does not found any error in these functions...

actorscontroller.cpp

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "ActorsController.h"
 #include "Drone_follower.h"
 #include "Messages.h"
 #include "CustomData.h"
 #include "EngineUtils.h"
 
 
 // Sets default values
 AActorsController::AActorsController()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
 
     //Istantiate Communication Component
     OurCommunicationComponent = CreateDefaultSubobject<UUDP_Component>(TEXT("Communication Component"));
 
 }
 
 // Called when the game starts or when spawned
 void AActorsController::BeginPlay()
 {
     Super::BeginPlay();
     
 }
 
 // Called every frame
 void AActorsController::Tick(float DeltaTime)
 {
     Super::Tick(DeltaTime);
 
     // Get Data
     OurCommunicationComponent->GetData(&ReceivedData);    //Store in a local variable the received data
 
     //Serialize received data
     /*for (i = 0; i < sizeof(struct FCustomPoseData); i++){
         *((uint8*)(&VehiclePose) + i) = ReceivedData[i];
     }*/
 }
 
 void AActorsController::ReturnNewData(FCustomPoseData *NewData) {
     *NewData = ReceivedData;
 }
 
 void AActorsController::PreInitializeComponents() {
     Super::PreInitializeComponents();
     OurCommunicationComponent->StartUDPComm("PawnCommunicationComponent");
 }
 
 
avatar image masternick95 Feb 09 '18 at 10:49 PM

Ball.cpp

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "Ball.h"
 #include "Messages.h"
 #include "CustomData.h"
 #include "ActorsController.h"
 #include "Drone_follower.h"
 
 
 // Sets default values
 ABall::ABall()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
     SetActorLocation(FVector(0.0f, 0.0f, 29.0f));
 
     //Instantiate static mesh component
     BallVisibleComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("BallVisibleComponent"));
 
     //Get actor controller pointer
     //Get ActorsController pointer for receiving position
     for (TObjectIterator<AActorsController> Itr; Itr; ++Itr) {
         if (Itr->IsA(AActorsController::StaticClass())) {
             ActorController = *Itr;
         }
     }
 }
 
 // Called when the game starts or when spawned
 void ABall::BeginPlay()
 {
     Super::BeginPlay();
     SetActorLocation(FVector(0.0f, 0.0f, 0.0f));
 }
 
 // Called every frame
 void ABall::Tick(float DeltaTime)
 {
     FCustomPoseData NewData;
 
     Super::Tick(DeltaTime);
     
     ActorController->ReturnNewData(&NewData);
     SetPose(&NewData);
 }
 
 void ABall::SetPose(FCustomPoseData* ReceivedData) {
     FVector Position;
 
     //Received measures are in cm --> convert into m
     Position.X = 100 * ReceivedData->ball_X;
     Position.Y = 100 * ReceivedData->ball_Y;
     Position.Z = 100 * ReceivedData->ball_Z;
 
     SetActorLocation(Position);
 }
avatar image vr_marco Feb 09 '18 at 11:54 PM

Are you sure this is right?

 void AActorsController::ReturnNewData(FCustomPoseData *NewData) {
      *NewData = ReceivedData;
  }

avatar image masternick95 Feb 10 '18 at 09:27 AM

Yes, I do not see any error, is declared here in the ActorsController.h file: // Fill out your copyright notice in the Description page of Project Settings.

 #pragma once
 
 #include "CoreMinimal.h"
 #include "GameFramework/Actor.h"
 #include "UDP_Component.h"
 #include "CustomData.h"
 #include "ActorsController.generated.h"
 
 UCLASS()
 class DRONE_FOLLOWER_API AActorsController : public AActor
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     AActorsController();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
     virtual void Tick(float DeltaTime) override;
 
     virtual void PreInitializeComponents() override;
 
     void ReturnNewData(FCustomPoseData* NewData);
 
 private:
 
     UPROPERTY(EditAnywhere, Category = "Remote Address")
     class UUDP_Component* OurCommunicationComponent;
     
     FCustomPoseData ReceivedData;
 };
 
avatar image vr_marco Feb 10 '18 at 10:12 AM

I believe the problem is in this assignment:

 *NewData = ReceivedData;

How are you allocating memory to the pointer before the assignment?

avatar image masternick95 Feb 10 '18 at 10:34 AM

The Ball class creates a local variable and then calls that method:

 FCustomPoseData NewData;
  
      Super::Tick(DeltaTime);
      
      ActorController->ReturnNewData(&NewData);
(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