Spawn Prefab Action: Difference between revisions

From Pummel Party Mod Documentation
Jump to navigation Jump to search
No edit summary
(Added image and updated info)
Line 1: Line 1:
An action to spawn a prefab at a gameobject's position and rotation.
[[File:SpawnPrefabAction.png|thumb|right|600px|A Spawn Prefab action that will randomly choose between two prefabs to spawn at three transform positions.]]
An action to spawn a [[Prefab Asset|prefab]] at a [[Gameobject|gameobject]]'s position and rotation.


Although multiple prefabs can be provided, only the first in the list will be spawned (May change in the future).
Multiple prefabs can be provided to this action. The prefab spawned when the action is invoked is chosen randomly.
The prefab will be spawned at the position of all targets provided if using the ''Advanced'' Target option. A prefab will also be spawned at the position of the gameobject if ''This Object'' is enabled as a Target.
The prefab will be spawned at the position of all targets provided if using the ''Advanced'' Target option.


The prefab(s) can also be spawned using a position or rotation offset from the target. This offset is applied to all prefabs spawned using the action. If you want different offsets per target, use multiple [[Spawn Prefab Action]]s.
A prefab can also/alternatively be spawned at a provided position and rotation. This position/rotation is in world space. If you want to spawn multiple prefabs at different world positions, use use multiple [[Spawn Prefab Action]]s, or use empty gameobjects as spawn points and set them as targets.


[[Category:Actions]]
[[Category:Actions]]

Revision as of 02:17, 7 December 2022

A Spawn Prefab action that will randomly choose between two prefabs to spawn at three transform positions.

An action to spawn a prefab at a gameobject's position and rotation.

Multiple prefabs can be provided to this action. The prefab spawned when the action is invoked is chosen randomly. The prefab will be spawned at the position of all targets provided if using the Advanced Target option.

A prefab can also/alternatively be spawned at a provided position and rotation. This position/rotation is in world space. If you want to spawn multiple prefabs at different world positions, use use multiple Spawn Prefab Actions, or use empty gameobjects as spawn points and set them as targets.