Announcement

Collapse
No announcement yet.

Need help applying physics to a selected list of random objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help applying physics to a selected list of random objects

    Hello,

    I'm just wondering if there is a way to apply physics to random object which are practically a copy of one modified cube (of course there will be a delay between each). I know how to enable/disable physics in a blueprint but selecting a list of object and selecting one of them randomly is the part that I don't really know how should I do it.

    Thanks in advance,

    #2
    You can use Get All Actors Of Class. Specify a hint for the actors in the scene such as staticmesh or parent blueprint etc. Then set the result to an array at game startup or periodically on a timer if objects are spawned dynamically at runtime (never do this in Tick). Then use the Get node along with a Random Integer In Range node using the max array size to clamp the range... That will return one random object at a time. If you need to get a list of random objects all in one go. Do the above first, but then use the Add Unique node to add each result to another array...
    Last edited by EntrpriseCustomr; 11-23-2019, 10:18 PM.

    Comment


      #3
      Originally posted by ClavosTech View Post
      You can use Get All Actors Of Class. Specify a hint for the actors in the scene such as staticmesh or parent blueprint etc. Then set the result to an array at game startup or periodically on a timer if objects are spawned dynamically at runtime (never do this in Tick). Then use the Get node along with a Random Integer In Range node using the max array size to clamp the range... That will return one random object at a time. If you need to get a list of random objects all in one go. Do the above first, but then use the Add Unique node to add each result to another array...
      Thank you so much!!! It worked!!

      Comment

      Working...
      X