Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 billyjoetyler · Nov 03, 2014 at 10:23 PM · selectionselectselectedselectiveselections

RTS. shift select.

hi, I am currently following this tutorial, but I have a question does anyone know how to intigrate a shift and click system to either select an extra object or to remove the object from a selection.

any help is welcome.

Comment
Add comment · Show 1
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 Linus · Nov 03, 2014 at 10:33 PM 0
Share

Could you be more specific on what exactly you are struggling with?

I have watched that video serie, I recommend watching the later videos as well before trying to replicate the project. As the tutorial maker is learning things himself as time progress and he changes things in later videos.

Basic steps: - Detect if shift is pressed - If unit is clicked, add to a list/array of selected units (I prefer Generic List http://wiki.unity3d.com/index.php?title=Which_$$anonymous$$ind_Of_Array_Or_Collection_Should_I_Use?#Generic_List ) - $$anonymous$$anage the list with foreach(Unit/Transform/OrAnytype unit in Units){unit.giveOrder()`}`

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Cynikal · Nov 03, 2014 at 11:06 PM

When I was making a similar system, the way I did it was...

When I clicked an object (that had a collider), I added it to a List.

Then, i'd instantiate a "selection" indicator (3d models that's a Circle) at the base of the object I clicked on.

If SHIFT is held down when left clicking, i'd List.Add(GameObject_I_Clicked_On)... If it was NOT held down, i'd clear the list, and just add the specific game object.

Comment
Add comment · Show 1 · 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
avatar image billyjoetyler · Nov 04, 2014 at 03:45 PM 0
Share

thank you, but I don't know how I would intigrate this with the selection box

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Click anywhere to deselect active GameObject 3 Answers

Box Selecting Top-Level Transforms Only 0 Answers

How to select a hidden MeshRenderer in SceneView? 0 Answers

How to multi-select scene hierarchy objects in code 0 Answers

Hexagon A* Pathfinding - limiting path length 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