👆
Nice Interaction System
  • 👋Welcome - Nice Interaction System Documentation
  • 🔌Integration in your project
  • 🎥Video Tutorials - Overview
  • ☑️Enable/Disable Interaction System
  • 🚪How to make any actor interactable
  • 🫥Add outline to your project and enable it in your map
  • 🌳How to make foliage interactable
  • Trace/Focus Methods
  • 👆Interaction Methods
  • Save & Load Game
  • ✊Pick up interactable (destroy it) actor/foliage
  • 📩Interaction Notify events for player (Event Dispatchers and Interface)
  • 🌲Foliage PCG instances
  • 🪵Foliage Destruction effect
  • 🌱Foliage Respawning
  • 🌳Foliage Collision after interaction
  • 🫂Replicated multiplayer interaction
  • 📪Redirected interaction
  • 🥡Interactables in interactable (example Dressers)
  • 🧸Random interactable spawning
  • 🔝Top Down Mode
  • 📜Trace/Focus Interactable ID whitelist
  • ❌Deny Interactions
  • 🧲Auto Interact (auto pick up)
  • 🔊Play Sounds on damaging and destruction
  • ⛏️Custom specific conditions to interact
  • ⌨️Change interaction key [E]
  • 💠Add new interaction widget styles
  • ✈️Seamless Server Travel
  • On switching/possessing pawn/character
  • 🐞Bug Fixes
Powered by GitBook
On this page

Random interactable spawning

PreviousInteractables in interactable (example Dressers)NextTop Down Mode

Create an actor (it does not need to be set to Replicates) because this actor should only do stuff happening on the server. Now add some components to your actor (arrow components are recommended). In this example they are called spawnpoint1, spawnpoint2, spawnpoint3.

Then add the AC_RandomInteractableSpawning component to your actor and on EventBeginPlay you can call something like this:

To define which interactables should be spawned with the function SpawnRandomInteractables you can select AC_RandomInteractableSpawning and in the Details tab you can add some array elements to RandomInteractablesSpawning. There you can choose the interactable class and how high the probability should be that it will spawn. You can also add the same class several times in different array elements. So it could be possible that it spawns an interactable of the same class 0, 1 or 2 times. Moreover you can adjust the spawn transform or make the yaw random (z axis rotation) to add some variation.

BP_Dresser is an example for that but is a bit more complicated since the spawn points are taken from drawer actors that first need to be spawned.

You can also spawn only one custom interactable like so:

Interactables that you spawn with this random interactable spawning component should not simulate physics. This could cause some problems because the interactable actors will be attached to their related spawn point components.

🧸