• 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 question was closed Jun 16, 2016 at 07:51 PM by Drummermonkey01 for the following reason:

Other

avatar image
0
Question by Drummermonkey01 · Jun 13, 2016 at 03:09 PM · 3d

Simulating a slide to unlock in 3d unity?

Hi there I really could use some help with this!

How would I be able to Simulate the slide to unlock feature on the iphone but not using sprites and using 3d objects?

So that once the object has slide to the side, the object (or something else) fades away. I dont really know where to start with this.

Thank you!!!

Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
0

Answer by Dibbie · Jun 14, 2016 at 07:23 AM

That sounds like a pretty interesting idea.

Well, you can get "input" on a 3D object if it has a collider, and a Rigidbody (in your case, you probably dont want "use gravity" turned on), and a Event Trigger component. That lets you do simple things such as click down, click up, click hold, drag, release, and so on - the same kind of stuff youd be able to do with a sprite and the mouse for the most part...

Essentially, how the Trigger Event component works in a nutshell is: Youd create your script, make a public void function with no paramaters - for example: public void HandleMouseHold(){} In that, youd do your magic there.

Youd then attach that script to an object, could even be the same object you are trying to create the slide effect on. From the Trigger Event, you can add a "MouseDown" event, and select your game object with that script on it, then you can select the script from the dropdown and the public functions attached to that script as well.

This would essentially allow you to achieve a slide effect with 3D objects.

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 CameronPenner · Jun 15, 2016 at 06:15 AM 0
Share

I might try using a scrollrect. set it to horizontal movement only. Use the OnValueChanged event to check if the slider is all the way to the side.

scrollrect documentation: http://docs.unity3d.com/$$anonymous$$anual/script-ScrollRect.html

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

46 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

Related Questions

Struggling with bounce pad in platformer game. 1 Answer

Input Dispatching issue ANR reports in Unity 3D Game on Android platform 0 Answers

Google Maps Platform Integration 0 Answers

Best Way To Have An Enemy NPC Chat With Player 0 Answers

Hurtbox colliders without using prefabs or primitives? 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