Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by OracleForms11g · Aug 30, 2018 at 06:38 PM · colliderspositioningoverlapitem pickupinstantiating

Spawning an object on the opposite side of an activator object with no overlaps

I'm currently working on a vaporwave roguelite game, and there's going to have items that can spawn from chests that can appear in specials rooms.

In order to get the items in chests, the player needs to manually open these.

Some of these items also spawn with a decorative pedestal (because they are unique/important). items that rests on pedestals are also kinematic. Also, every chests are resting on those pedestals.

So when I spawn items with pedestals, I need to make sure to place these items correctly so no pedestals overlapping.

Here are some sketches to help visualize this:

alt text

The green boxes represent a pedestal bounds. The dotted square is the bound of the newly spawned pedestal.

I do have C1 (the position of the chest's pedestal) and A (the position of the activator, hence the player in this case)

So I need to get Cx while making sure that none of these bounds overlaps.

I do have some idea of how to do it, but I'm feeling like I'm missing something...

My guess is to get some kind of radius of each bound and simply get Cx by using the normalized direction made by subtracting A and C1 multiplied by each of those bounds radii.

But is there a better way to do it? The main grunge I have with this way is that I need to use square roots, and I kinda want to avoid that...

center1.png (22.4 kB)
Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image eses · Aug 30, 2018 at 07:50 PM 0
Share

@OracleForms11g - So this is not a tilebased roguelike or -lite?

avatar image OracleForms11g eses · Aug 30, 2018 at 07:52 PM 0
Share

No, its not a tile based roguelite. In fact, It's in first person.

avatar image eses OracleForms11g · Aug 30, 2018 at 07:55 PM 0
Share

@OracleForms11g - How exactly the items must be placed, does it actually matter if they overlap a bit. Alternatively, can't you just use predefined spawn points around a chest?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by OracleForms11g · Aug 31, 2018 at 04:00 PM

The idea proposed by @eses works nicely.

> Alternatively, can't you just use predefined spawn points around a chest? - @eses

I've even add some lerps to it so that there can be slight variations to positions.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

89 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Make mesh from overlapping colliders/triggers 0 Answers

How to Pick up 1 collider Object at a time, Vs. all at once? 2 Answers

GUILayout Positioning for SelectionGrids and Buttons 2 Answers

How to find the closest point outside a collider from a point inside the collider. 1 Answer

Model Teleports after Animation From Spawn to Idle. Collider doesn't follow 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges