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"

Keeps crashing after successfull C++ component build from VS

I have been having this issue for more than 2 days now. It was working just fine 3 days ago though and now its being all buggy and having issues that make no sense. What I did is access the start content stuff and throw a door and a door frame on the level in the editor. Then I created a c++ component called opendoor which would access the actor and swing open the door with frotator. This all went fine 3 days ago and was working but crashed later on after adding more code building. Today I made a new project and went back to the start again and now it wont even let me make the opendoor component. Right after I built the project in Visual Studio and it went successful the editor crashed showing the error below. Now every time I try to go back into it its the same thing as the project from 3 days ago with the same error log. Don't understand. This is making me really want to stop getting into Unreal Editor and find a new game engine. Can anyone help?It looks like its saying access violation. What does the error log mean?

alt text

Product Version: UE 4.15
Tags:
bullshitunreal.png (199.7 kB)
more ▼

asked Aug 02 '17 at 02:58 AM in Bug Reports

avatar image

ExtrudE57
1

avatar image ImVawx ♦♦ STAFF Aug 03 '17 at 02:53 PM

How are you calling the GetFirstPlayerController( ) function from a UWorld reference?

Can you post the code that you have written that does this?

Thanks.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I've been following a course on Udemy.com with videos on how to use Unreal so that is where this code is coming from. However it won't work once I initialize ActorThatOpens in the openDoor default constructor. I take that part out and it fires up but I can't open a door unless I eject and set the door to the default pawn created at run time, which is problematic. Note that PressurePlate is the trigger volume in front of the door and is connected to the door being opened. Once there is a overlap of the PressurePlate and the ActorThatOpens (default pawn) the door should open.

openDoor.cpp

 UopenDoor::UopenDoor()
 {
     PrimaryComponentTick.bCanEverTick = true;
     ActorThatOpens = GetWorld()->GetFirstPlayerController()->GetPawn(); // <---The problem here
     
 }
 
 
 // Called when the game starts
 void UopenDoor::BeginPlay()
 {
     Super::BeginPlay();
     //    OpenDoor();
     // ...
     
 }
 
 void UopenDoor::OpenDoor()
 {
     AActor * owner = GetOwner();
     FRotator rotator = FRotator(0.f, -55.f, 0.f);
     owner->SetActorRotation(rotator);
 }
 
 
 void UopenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
 {
     Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
 
     if (PressurePlate->IsOverlappingActor(ActorThatOpens)) {
         OpenDoor();
 }
     // ...
 }


openDoor.h

 UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
 class BUILDINGESCAPE_API UopenDoor : public UActorComponent
 {
     GENERATED_BODY()
 
 public:    
     // Sets default values for this component's properties
     UopenDoor();
 
 protected:
     // Called when the game starts
     virtual void BeginPlay() override;
 
     void OpenDoor();
 
 public:    
     // Called every frame
     virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
 
 private:
     UPROPERTY(VisibleAnywhere)
         float OpenAngle = 90.0f;
     UPROPERTY(EditAnywhere)
         ATriggerVolume* PressurePlate;
         AActor* ActorThatOpens;
 };
more ▼

answered Aug 03 '17 at 08:23 PM

avatar image

ExtrudE57
1

(comments are locked)
10|2000 characters needed characters left
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