tcubeactor.h
#pragma oncetcubeactor.cpp#include "coreminimal.h"
#include "gameframework/actor.h"
#include "runtime/engine/classes/components/staticmeshcomponent.h"
#include "tcubeactor.generated.h"
uclass()
class tvivimovedemo3_api atcubeactor : public aactor
;
#include "tcubeactor.h"重點在於把cube提公升為rootcomp,否則建立出來cube永遠在v(0,0,0)點,即使actor點位置動態改變cube絕對位置也不隨actor改變// sets default values
atcubeactor::atcubeactor()
// called when the game starts or when spawned
void atcubeactor::beginplay()
// called every frame
void atcubeactor::tick(float deltatime)
加乙個cube,開啟物理開關
一些問題記錄
可以使用
ustaticmeshcomponent * cubemesh = findcomponentbyclass();開啟關閉物理cubemesh->setsimulatephysics(true);
如果tcubebp中物理沒開啟,可以直接通過setactorlocation設定cube位置(rootcomp被修改為cube後)
如果tcubebp中物理已經開啟,那麼動態關掉物理後cube物理效果是沒了,但是不能再通過setactorlocation設定位置,原因未知
UE4C 建立列舉
目錄 一 目的 1 想 ue4使用c 建立列舉變數適用於c 與藍圖 二 參考 1 ue4使用c 建立列舉變數適用於c 與藍圖 三 注意 1 c 類最好是actor型別,發現gamemodebase型別我在場景中沒有找到 四 操作 1 新建actor的c 類mygamemodebase.h 1 myg...
UE4 C 使用反射
使用 ufunction rightfunc this findfunction fname text onrightmousepressed if rightfunc processevent rightfunc,nullptr 藍圖直接使用藍圖物件根據方法名取得方法 注意 onrightmous...
Ue4C 程式設計 總結篇
通過前面的一系列文章,已經將遊戲的基礎組成要素已經講完了,當然,都是單機的,不涉及網路部分。通過前面的一系列文章,我想製作乙個簡單的遊戲demo也不難了吧。umg是製作遊戲介面乙個十分簡便,強大的模組,它是由封裝自slate。slate有興趣的可以看下官方文件,是純用 編寫介面的,我更喜歡視覺化的u...