I have C++ Character class called VRCharacter with the attributes programmed in C++ as follow:
VRRoot = CreateDefaultSubobject<USceneComponent>(TEXT("VRRoot"));
VRRoot->SetupAttachment(GetRootComponent());
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->SetupAttachment(VRRoot);
DestinationMarker = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("DestinationMarker"));
DestinationMarker->SetupAttachment(GetRootComponent());
And I have created a blueprint with the VRCharacter as its parent and when I open the blueprint, i can see all the attributes I declared in the code as shown below:
And I can see on the top right written that the parent is VRCharacter
But when I play the game and navigate to the VRCharacter in the scene, I don't see all the attributes, I can only see the Mesh and the DestinationMarker as shown in the picture below:
And when I apply some changes to the DestinationMarker from the blueprint such as changing the Static Mesh, it doesn't get applied to the VRCharacter in play mode.
Why my blueprint doesn't affect its parent? is there anything I might be doing wrong?
It looks like you added the C++ class to the scene instead of your blueprint 'subclass'. Try dragging your BP_VRCharacter into the scene, and the world outliner should display 'BP_VRCharacter' as type instead of 'VRCharacter'
Related
Actually, I was trying to change the skeletal mesh of car in UE4, in the wheeled vehicle demo project which comes in ue4 c++ API.
Firstly I inherited blueprint from ue4 wheeled vehicle c++ class.
Then I opened blueprint editor and replaced default skeletal mesh to my skeletal mesh.
I assigned bone names correctly.
Then everything was in its place(according to me)
Then I recompiled.
Then I placed blueprint in level and possess it. But when I clicked W,A,S,D keys it doesn't work. And the car doesn't move at all.
If I am doing any mistake, please guide me through steps and how can I resolve it.
The animation blueprint is also tied to a specific Skeleton. If your new skeletal mesh uses a different skeleton than the one currently assigned to your skeletal mesh component, then you will need to create a new corresponding animation blueprint to use with it.
I want to create a slider that can adjust the brightness of a game in Unreal Engine 4, but I don't know which module to use in blueprints to adjust brightness. Which blueprint module should I attach to the module for the slider's value change? Should this even be done in blueprints, or should I do it in C++ instead?
You could try a post-process actor, and change its brightness value via blueprint
so I am trying to understand drawing in Qt, but I dont get this one:
So first of all I had a qml file where I embedded a custom class called Game which has this constructor: Game::Game(QQuickItem *parent) : QQuickItem(parent)
Writing setFlag(ItemHasContents, true); in the constructor code was sufficient to being able to draw with QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); using QSGGeometry (This worked). Now I tried to draw in a subclass, using the same procedure but now it does not work anymore: So what I did was create a class called qcurver, and in Game I create an instance of qcurver. QCurver has the same constructor like Game and I pass the parent of Game so that technically it has the same parent as Game, but now when I try to draw in this class, nothing happens. Does anyone know, how I can pass the QML object for drawing, so that I actually see the drawing?
You're creating a Game object from QML code, so it's registered correctly in the QML scene. But the QCurver isn't created there, so it won't work.
Yes, it has the same parent, but it only means that if the parent gets deleted - the QCurver will be deleted too. Qt doesn't revise all QObjects that are added as children to find out if they are of type QQuickItem and should be rendered.
Also, QML itself was added to be able to avoid doing widget hierarchies in C++. So, compose hierarchies in QML. Or, if you want some of them in C++ for the performance reasons - then it is possible to do QSGNode hierarchies inside a QQuickItem (that's useful for rendering complex scenes with OpenGL).
I loaded a .fbx object named "plane" into my content folder. I have an empty Actor on the scene with an Added C++ Scene Component. Using the C++ code, I'd like to access my .fbx object "Plane" and load it to the scene through CODE. Much like in unity ex:
Instantiate(Resources.Load(FILEPATH),new Vector3(x,y,z),new Quaternion());
You can't just place a fbx file into your level, you have to use an actor for that. Add a static mesh component to your actor and on this component set the mesh to your fbx asset.
You can not directly load stuff from files in C++, you have to use the names from imported assets. The whole point of this is that you can move files and assets around without your code breaking.
I just want to ask that I have my custom shape physical body, let say, I have a STAR having four outside and four inside vertices, and made with Physics Editor.
By using that Plist generated by Physics Editor, the body shows and behaving just perfect, but problem is that I could not get fixture(s) of that custom shape to get collision detection or any thing else.
So, how could I get the fixture(s) of custom physical shape body made with physics editor, so I can detect collision?
P.S: I have MyContactListener class that is working fine with basic shapes like circle and line.
Thanks in advance.