用c++建立乙個發射平台,可以把重疊的角色彈射出去,也可以把開啟了物理模擬的物體彈射出去。
這是udemy上教程的挑戰任務,最近一直在跟著教程做,從一開始的完全懵逼到現在逐漸理解,非常有收穫。
**如下:
fpslaunchpad.h
#pragma once
#include "coreminimal.h"
#include "gameframework/actor.h"
#include "fpslaunchpad.generated.h"
class ustaticmeshcomponent;
class uboxcomponent;
class uarrowcomponent;
uclass()
class fpsgame_api afpslaunchpad : public aactor;
fpslaunchpad.cpp
#include "fpslaunchpad.h"
#include "components/boxcomponent.h"
#include "components/staticmeshcomponent.h"
#include "components/arrowcomponent.h"
#include "gameframework/character.h"
#include "kismet/gameplaystatics.h"
// sets default values
afpslaunchpad::afpslaunchpad()
//發射平台重疊事件的實現
else if(othercomp&&othercomp->issimulatingphysics())//開啟了物理模擬的其它元件 }
UE4 C 使用反射
使用 ufunction rightfunc this findfunction fname text onrightmousepressed if rightfunc processevent rightfunc,nullptr 藍圖直接使用藍圖物件根據方法名取得方法 注意 onrightmous...
UE4C 建立列舉
目錄 一 目的 1 想 ue4使用c 建立列舉變數適用於c 與藍圖 二 參考 1 ue4使用c 建立列舉變數適用於c 與藍圖 三 注意 1 c 類最好是actor型別,發現gamemodebase型別我在場景中沒有找到 四 操作 1 新建actor的c 類mygamemodebase.h 1 myg...
Ue4C 程式設計 總結篇
通過前面的一系列文章,已經將遊戲的基礎組成要素已經講完了,當然,都是單機的,不涉及網路部分。通過前面的一系列文章,我想製作乙個簡單的遊戲demo也不難了吧。umg是製作遊戲介面乙個十分簡便,強大的模組,它是由封裝自slate。slate有興趣的可以看下官方文件,是純用 編寫介面的,我更喜歡視覺化的u...