Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit spawn randomization #117

Open
XZRRRRRR opened this issue Nov 16, 2022 · 1 comment
Open

Limit spawn randomization #117

XZRRRRRR opened this issue Nov 16, 2022 · 1 comment

Comments

@XZRRRRRR
Copy link

How can I realize that the z coordinate of the generated object is fixed, and the x and y coordinates are randomly generated?

@mrkcass
Copy link

mrkcass commented Jan 5, 2023

Couple ways to do this.

Modify unreal actor random movement component

If you are using the NDDS movement randomization component, then this is the preferred method.

The movement randomization component allows the range of motion to be configured and constrained per axis.

  • Open the objects actor (blueprint) in the blueprint editor.
  • Locate the components panel.
  • Locate the random movement component and select the component.
  • Locate the component properties panel and enable/disable axis as needed.

Modify the unreal actor

if you are allowing the physics engine to move the object (not using a randomization component i.e. falling things), You need to modify the actors (blueprint) physics property named "Constraints" to restrict motion for an axis.

  • Open the objects actor (blueprint) in the blueprint editor.
  • Locate the components panel and select the physics component (bounding box).
  • Locate the component properties panel (now displaying physics component properties).
  • Scroll to the Physics section of the panel.
  • Expand the section and then toggle the "Lock position" axis constraint controls.

image

Get creative with camera position, invisible walls and rigging

Something to keep in mind is that Unreal is a tiny movie production studio. As in movies, the 3D representation need only be sufficient in detail to generate the desired 2D representation. I always say that: "The imaging need only fool a fish, whose only assets are patience and a vision system, tuned and tested, for more than 500 million years!"

For Instance

  • Build invisible wall systems to guide objects. For example, you could create a funnel using invisible walls and drop objects into the funnel. The shape of the funnel would control the move movement of objects.
  • Adjust the friction of the funnel and objects physics material to vary momentum.
  • Adjust the rigidity of the objects physics material to make them bounce.
  • Rotate the invisible wall funnel (created above) and camera, as a single object, about the combined center of rotation, so that from the cameras perspective there is zero rotation. This will cause objects to drop down an inclined slope, directing the objects to a specific region of the camera frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants