Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
  • Help Room /
This post is currently awaiting moderation. If you believe this to be in error, contact a system administrator.
This question was closed Sep 13, 2018 at 12:29 PM by Hellium for the following reason:

Duplicate Question

avatar image
0
Question by sokx_ · Sep 13, 2018 at 10:31 AM · rotationpick up object

How can I pick up cubes?

Hi guys, I'm trying to write a script to attach to a certain weapon that will allow me to pick up and move the cube it's aiming at, I don't need to be able to move them along the x and y axis, just moving them up and down. I have been unable to find a working tutorial on youtube or anywhere else.

Another feature I would like to implement but not right away, would be to select a limited amount of blocks to raise together, but for now I just need to be able to select a cube and raise it up into the air.

Thanks guys.

Comment
Comments Locked · 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 · Sep 13, 2018 at 10:42 AM 0
Share

Hi @sokx_

you are asking for a tailor made solution with various steps. You don't find such often, unless your request is very generic request.

Just split your idea to smaller steps/components, and search for these.

These all have been asked here more or less, and there is abundance of tutorials in YouTube.

If you say you are trying to write a script, and you'd like to implement something - then do so - then show something you have so far, and most people can probably help you, now someone could only write the code / pseudo code for you.

avatar image sokx_ · Sep 13, 2018 at 10:58 AM 0
Share

Hmmm, ok, I found a tutorial that does seem to work for me, my only problem is that the cube moves on all axis and follows the camera, while it might be vague do you know how to get the selected cube to only translate along the y axis?

avatar image eses sokx_ · Sep 13, 2018 at 11:23 AM 0
Share

@sokx_ - I've got no idea what tutorial you are watching, what you have done, and how your scene setup is. Try it out properly, until you can't get further - and then form a question that anyone can understand - that way you'll help yourself and others.

avatar image maxoja · Sep 13, 2018 at 11:51 AM 0
Share

Can you give us some reference about what you want to implement. Your statements are clear but not illustrative enough.

avatar image _Venus_ · Sep 13, 2018 at 12:04 PM 0
Share

You can try using a raycast system, which you can find here: https://docs.unity3d.com/ScriptReference/Physics.Raycast.html

When the raycast hits a object, that has a matching tag or gameobject name, you can assign it as a child to the weapon: https://docs.unity3d.com/ScriptReference/Transform.SetParent.html. This will make it so that the cube thats "picked up" would be following the weapons movement.

avatar image Hellium · Sep 13, 2018 at 12:27 PM 1
Share

Unity Answers is not a free coding service:

FAQ :

Some reasons for getting a post rejected:

  • There exists duplicate questions with answers if you were to do a search, either on Answers or on the Forum or on Unity's tutorials

  • Your question isn't specific enough: asking for a script, asking multiple questions in one post or asking a question that could be either subjective or require extensive discussion

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

122 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

Related Questions

Rotation problem: Object rotates but shouldn't 0 Answers

Rotation of game objects 0 Answers

Rotate Player w/Touch Input Controls 0 Answers

Problem with movement while rotating the character 0 Answers

How to make an object do a multiple tasks forever 1 Answer


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