Announcement

Collapse
No announcement yet.

Trouble getting new class to show up in the UE4, Youtube Intro to programming.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trouble getting new class to show up in the UE4, Youtube Intro to programming.

    Hey, new to coding and I'm stuck on something in this tutorial. https://www.youtube.com/watch?v=Q3AvZmZEPyc

    I've been trying for hours and just can't get my new class to show up in UE4, I need some help.

    I'm following the tutorial to the letter, so far as I can tell, no typos in the code. It compiles without errors, but I can't find the new class in the UE4 menus.

    Check video at 15:50

    The new base class "Powerup" shows up for him, but not for me.


    Another thing, is when he selects an object and in the Details panel, clicks the link to the .h file, Visual Studio does not load up for me like in the video. Does that feature not work with VS 2013 Express?



    Note: I also tried the tutorial here for creating a new class to print "Hello World", and it worked easily. I'm not sure why the other "Powerup" class doesn't show up.

    https://docs.unrealengine.com/latest...t/3/index.html









    Code:
    //Powerup.h
    
    
    
    // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
    
    #pragma once
    
    #include "GameFramework/Actor.h"
    #include "Powerup.generated.h"
    
    /**
     * 
     */
    UCLASS()
    class APowerup : public AActor
    {
    	GENERATED_UCLASS_BODY()
    
    	UPROPERTY(EditDefaultsOnly, VisibleDefaultsOnly, Category = Powerup)
    	TSubobjectPtr<USphereComponent> TouchSphere;
    	
    	UPROPERTY(EditDefaultsOnly, VisibleDefaultsOnly, Category = Powerup)
    		float RotationRate;
    
    	virtual void Tick(float DeltaTime) OVERRIDE;
    
    	
    };


    Code:
    //Powerup.cpp
    
    
    
    // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
    
    #include "Pizza.h"
    #include "Powerup.h"
    
    
    APowerup::APowerup(const class FPostConstructInitializeProperties& PCIP)
    	: Super(PCIP)
    {
    	PrimaryActorTick.bCanEverTick = true;
    
    
    	TouchSphere = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("TouchSphereComponent"));
    	TouchSphere->SetSphereRadius(20.f, false);
    	RootComponent = TouchSphere;
    
    	RotationRate = 180.f;
    
    
    }
    
    void APowerup::Tick(float DeltaTime)
    {
    	Super::Tick(DeltaTime);
    
    	FRotator MyRot = GetActorRotation();
    	MyRot.Roll += RotationRate * DeltaTime;
    	SetActorRotation(MyRot);
    
    }

    #2
    You mean it does not show up in class list? Did you checked it under Actor class as it is it's parent?
    =========
    My Tutorials:
    Basic knowledge about Classes and UObject environment and stuff like that

    Comment


      #3
      Try to close the Unreal Editor. Then rebuild your solution in Visual Studio (under the Build menu). Then run the editor again from Visual Studio (Debug->Start Without Debugging). Your new Powerup class should then be visible inside of the Unreal Editor.

      Comment


        #4
        Originally posted by Gabe687 View Post
        Another thing, is when he selects an object and in the Details panel, clicks the link to the .h file, Visual Studio does not load up for me like in the video. Does that feature not work with VS 2013 Express?
        It should work from VS Express...that's what I'm using and this feature is working for me.

        Comment


          #5
          Thank you, that's what I needed! Building with (Debug->Start Without Debugging) did the job.

          I was building by right clicking on the name of the game, "Pizza" and selecting Build. Then I was starting the editor through the source files, like I saw in this tutorial. https://www.youtube.com/watch?v=usjlNHPn-jo

          C:\Users\gabe\Documents\GitHub\UnrealEngine\Engine\Binaries\Win64\UE4Editor.exe




          Linking to code files in VS 2013 Express through the link in the Details panel of UE4, doesn't do anything for me. I don't know if you need a plugin to make that work or what?


          It doesn't do anything, and it doesn't matter if VS is closed at the time or already open.
          Last edited by Gabe687; 03-28-2014, 11:47 PM.

          Comment


            #6
            Hey, i have the same problem as pointed out in the first post. But the suggested solution did not work for me.

            I am working on a Mac OS (10.9.4) System with xCode Version 5.1.1 (5B1008) and Unreal Engine 4.4.1.
            I am collaborating (using git) with team members which are using windows machines.

            Has anyone a where my problem could be located?
            Last edited by SchmaR; 09-16-2014, 10:39 AM.

            Comment

            Working...
            X