I have a door class in c++ with a boolean bOpen to define that the door is open or closed at the beginning (makes sense, doesnt it?)
When i place a door into the world i can edit this property since it an EditInstanceOnly UPROPERTY.
When you then click on the checkbox bOpen PostEditChangeProperty is called and i check the property’s name if its
“bOpen”.
Regarding its state i simply call Open() or Close() and inside those i call other functions which do the desired rotation for me (enabling tick events, set up timelines and delegates a.s.o).
While those rotation functions are called by some miracle, Open() and Close() are not called and though i dont get the desired result.
However, when i place the same behaviour inside BeginPlay() everything works fine and the door rotates regarding bOpen.
I got a hint from a friend that the compiler might inline Open() and Close(), so they are not valid when in Editor-Mode.
If so can someone tell me how i can prevent functions from being inlined?
I tried UFUNTION() above those two, but it doesnt changed anything.
well imagine to have a door you place into the scene(in Editormode)
It is closed by default, but you want it to be open for this specific door-instance.
So you open the doordetails of your instanced door and check the bOpen state to true.
PostEditChangeProperty is called…
now i want to set the door to open (still in Editor) so you can “see” it to be open.
When you’re asking for help, you’re not going to get anywhere if you don’t post your code. You should be showing us the relevant functions. Open(), Close(), PostEditChangeProperty(), etc. Otherwise no one can magically know your problem.
Don’t use “this”, you very rarely ever use that. It’s best to use that only when you’re passing the instance of yourself (aka: “this instance”) to another function in another class. SomeOtherClass->SetOwner(this) for example.
On top of that using logging methods in your function to see where the code breaks. Open YourGame.H (main file) and add a Log category like so
#pragma once
#include "Engine.h"
#include "UnrealNetwork.h"
DEFINE_LOG_CATEGORY_STATIC(LogName, All, All);
now you can call upon that Log Type throughout your code to test things. Putting them in various places to see how they make or break your game. Like this,.