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 Jeeva3m · Dec 05, 2018 at 01:41 PM · gamegridboundsdrag-and-dropcard

How to Place and arrange 3D cards using Grid and Bounds

Hello friends,

I'm developing a Cards game (Like rummy/poker). Usually, the cards are in 2D, bit easy to handle drag cards and place one on the other in ScrollRect. When one UI item is dragged and dropped, other objects adjust accordingly. In my case, The 53 cards are 3D plane objects. 13 cards served to user. Now the user should drag and drop, sort, select multiple cards and group or place cards on the other card, accordingly other cards move and adjust above or below each other. Drag and drop done already. Seriously i dont know how to achieve the rest manually. Could some one help??// There's no much help in the forum or in google on this topic. As I've explored, it seems Grid Layout and Bounds would help in achieving this// But dont know how to implement bounds and Grid on my own. Unity documentation is just simple and not helping much. Please help.. Its been a week, breaking my head.. ! Please give some idea on how to arrange cards on proper intervals, managing one on the other adjusting accordingly etc., alt text

1.jpg (321.7 kB)
Comment
Add comment · Show 8
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 Jeeva3m · Dec 05, 2018 at 02:01 PM 0
Share

What you see in the screenshot, I've arranged cards on an interval of fixed value in x,y. This has to be arranged in grid and while dragging and dropping it should be automatically on grid and one on the other. Please help

avatar image Jeeva3m · Dec 05, 2018 at 02:06 PM 0
Share

@Eric5h5 Could you please guide? @robertbu could you help if possible?

avatar image Jeeva3m · Dec 06, 2018 at 06:00 AM 0
Share

could someone pls help........

avatar image NoDumbQuestion Jeeva3m · Dec 06, 2018 at 07:54 AM 0
Share

Use Pivot position from transform

In this case, it will transform.position.x

You would have a list of card transform or rectTransform

You just have to loop through that list and increment transform.position.x by a distance

avatar image Jeeva3m NoDumbQuestion · Dec 07, 2018 at 06:24 AM 0
Share

Hi, thanks for your reply. I did not use UI for the cards. I am using 3D cards. Yes i used the transform.position to arrange the cards. Arranging the cards and dragging them is ok. But It needs to be on dragged and kept on one another either above a card or below a card, And the other cards should move and give space accordingly. Do u have any idea of bounds and grids?

Show more comments
avatar image NoDumbQuestion · Dec 06, 2018 at 07:55 AM 0
Share

And another thing. It kinda dumb for using UI rect layout for card in both performance and code design term.

I would just use BoxCollider with On$$anonymous$$ouseDrag()

0 Replies

· Add your reply
  • Sort: 

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

132 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 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

Get position of the centre of each grid tile 1 Answer

Drag and Drop menu and Save load game. 0 Answers

Trading Card Game 5 Answers

Some questions regarding card game 2 Answers

Object within bounds of another object 2 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