Development Note #1
Introduction 👋
Welcome to my first development note. This is a series of posts about documenting tips/notes that I gathered during a personal project's development.
For this week, I have some notes relate to the UActorComponent and UMaterialInstanceDynamic from Unreal Engine.
Note 📝
- To set
CastShadowvalue at runtime, useSetCastShadow()function from theUActorComponentclass. This function will force the component to update in the next frame. Set variable directly will only work during construction. - To create a
UMaterialInstanceDynamicuse the static functionUMaterialInstanceDynamic::Create(Material, UObject);- Parameter: Material -> the parent material that need to be converted to instance dynamic.
- Parameter: UObject -> the world object in the game, use
thiskeyword is sufficient.
- To have
UPROPERTYbe placed in a specific spot in the detail panel, useDisplayPriorityorDisplayAfterinmetaspecifier. - To initialize an empty array of given type and given size, use
Array.Init({}, size);{}also work for passing an empty parameter, not pointer.