# C++ 里的staticmesh类型的数组怎么用啊

**URL:** <https://forums.unrealengine.com/t/c-staticmesh/12245>\
**Category:** 简体中文 (Simplified Chinese)\
**Tags:** unreal-engine\
**Created:** [September 29, 2014, 10:37am UTC](https://forums.unrealengine.com/t/c-staticmesh/12245 "2014-09-29T10:37:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_be458d0a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_be458d0a](https://forums.unrealengine.com/u/anonymous_user_be458d0a)\
**Post date:** [September 29, 2014, 10:37am UTC](https://forums.unrealengine.com/t/c-staticmesh/12245/1 "2014-09-29T10:37:53Z")

</div>

UPROPERTY(VisibleAnywhere, Category = WaveAtkClass)  
TArray\< TSubobjectPtr\<class UStaticMesh\> \> MeshesToSpawn;//数组

像上面那样声明一个数组，CPP文件里应该怎样初始化呢？数组成员的添加 我想在UE的Details里操作

Declare an array like the one above, the CPP file should be how to initialize? Adds an array of member I want to operate in UE Details

---

<div class="post-metadata">

**Author:** ![noslopforever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@noslopforever](https://forums.unrealengine.com/u/noslopforever)\
**Post date:** [October 29, 2014, 1:30am UTC](https://forums.unrealengine.com/t/c-staticmesh/12245/2 "2014-10-29T01:30:37Z")

</div>

SubobjectPtr好像是只能在构造函数里初始化

---

<div class="post-metadata">

**Author:** ![Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_22f547d62f00bac65c2343d67ba1c173](https://forums.unrealengine.com/u/Anonymous_22f547d62f00bac65c2343d67ba1c173)\
**Post date:** [March 31, 2016, 8:17pm UTC](https://forums.unrealengine.com/t/c-staticmesh/12245/3 "2016-03-31T20:17:50Z")

</div>

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...
