'StaticClass': identifier not found

I was trying to launch this script A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums , and i got a long list of “deprecated” errors. I corrected 'em all except one with NewObject getting a few errors:

Info Compiling game modules for hot reload

Info Performing 2 actions (4 in parallel)

Info MadMesh.cpp

Error e:\program files\udk\epic games\4.10\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(1122) : error C2027: use of undefined type ‘UBodySetup’

Error E:\Program Files\UDK\Epic Games\4.10\Engine\Source\Runtime\Engine\Classes\Engine/SkeletalMesh.h(598) : note: see declaration of ‘UBodySetup’

Error e:\program files\udk\epic games\4.10\engine\source\runtime\coreuobject\public\uobject\UObjectGlobals.h(1122) : error C3861: ‘StaticClass’: identifier not found

Info -------- End Detailed Actions Stats -----------------------------------------------------------

the line that makes these errors:

ModelBodySetup = NewObject();

how to create an object, or where is StaticClass identifier that is not found?

Hey RndMaker-

The wiki page you linked was authored in 4.7 and parts may be outdated with updates to the engine code. I believe you are using ModelBodySetup = NewObject(); in place of ModelBodySetup = ConstructObject(UBodySetup::StaticClass(), this);? If this is the case then the likely issue is that the NewObject call doesn’t know what type of object to create. Similar to the ConstructObject call, you must specify what is being created with NewObject inside a pair of angle bracket. Adding between NewObject and the open parenthesis should help fix the compile error you’re receiving.

Cheers

error list:

error C2027: use of undefined type ‘UBodySetup’

\Engine\Source\Runtime\Engine\Classes\Engine/SkeletalMesh.h(598): note: see declaration of ‘UBodySetup’

maybe i should include a header? i’ve already included these 3 files: Math/Vector.h, ProceduralMeshComponent.h, DynamicMeshBuilder.h

and it was “NewObject< UBodySetup>();” in my code, but local comment supplementer removed this “<(without space)UBodySetup>” from the comment text when i added it, and that code turned into NewObject() instead of being NewObject< UBodySetup>();

i’ve included PhysicsEngine/BodySetup.h, and now it’s working

Hi, I just started to learn using UE4 and am trying to launch the script too. My project compiles successfully. But I don’t know how to use the GameGeneratedActor. Would you please give me some tips?
So far, I’ve created a blueprint for GameGeneratedActor class and completed its event graph as following:

And i know i must have missed something, for I notice that there are some wires out of the picture in the tutorial script and when i run the program now,nothing happens. But I don’t know how to complete the event graph or whether I’ve run into the wrong direction. How to make the project work to get the final object drawn on the screen? What should i do with PCIP in the construc function :AGameGeneratedActor(const class FObjectInitializer& PCIP)?
I have no ideas now :frowning: . Please please please help me.

Hey -

Looking at your blueprint it appears that there is no event to trigger your spawn. From the input execution pin (white triangle on the left of the node) you need to connect a red event node such as Event BeginPlay or Event OnActorBeginOverlap. When the condition for the event triggers it will then fire each of the nodes connected to the execution chain for that event.

This question does not relate to the original issue being reported, so if you have any further questions it would be best to start a new post so that this information doesn’t get buried in this post and to make it easier for others with the same issue to search later.

Cheers