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 Drummermonkey01 · May 19, 2016 at 02:28 PM · 2d3d

2d sprite bacground motion?

Hello I really could use some help with this and this will need some explaining!

On the iphone homescreen there is a picture and when the device is titled left, right, up, or down the image slightly moves with it and then stops once the device has gone to far. It shows more of the picture in either directions when it is titled that way and then returns back to normal once not moving.

How would I be able to accomplish this in unity?

Any help would be appreciated!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by RussianBsack · May 19, 2016 at 03:04 PM

You'll need to use Unity's Gyroscope capabilities, Heres some links : http://docs.unity3d.com/ScriptReference/Input-gyro.html http://docs.unity3d.com/ScriptReference/Gyroscope.html

Depending on how much experience you've had, it will determine how well/easily you complete this. I'll explain how to do it as its the best way to learn, when i get home i'll add some code snippets.

Start by getting the input of the gyro and reversing it, then create a offset vector which will be your sprite transform, Create a clamp (Mathf.Clamp) - This will determine how much it will move, Then you create a smooth move function (possibly Vector3.MoveTowards), this will create that slow movement.

This is just a rough way of doing it which you will need to polish up!

Here is the code! https://gist.github.com/anonymous/22e450792a6272929b7ad52a85f752ea

Comment
Add comment · Show 7 · 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 Drummermonkey01 · May 19, 2016 at 03:17 PM 0
Share

Thank you! I do need some more explaining so the code snippet will help!!

avatar image Drummermonkey01 · May 20, 2016 at 03:07 PM 0
Share

Any Luck? @RussianBsack

avatar image RussianBsack · May 21, 2016 at 03:18 PM 0
Share

@drummermonkey01

Sorry dude, was a little busy with work. Add me on skype and I'll explain it to you there.

Skype - goldennoodles.

avatar image Drummermonkey01 RussianBsack · May 21, 2016 at 04:09 PM 0
Share

Have added you! and sent a message! @RussianBsack

avatar image RussianBsack Drummermonkey01 · May 21, 2016 at 04:54 PM 0
Share

@drummermonkey01

Still haven't received anything, what's your user? i'll try to add you.

Show more comments
Show more comments
avatar image
0

Answer by tanoshimi · May 19, 2016 at 03:01 PM

Using Input.gyro.attitude.

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

70 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

Related Questions

resizing spherecast radius over distance? 4 Answers

Isometric camera 2d or 3d 2 Answers

Close meshes render in 2D, but not 3D 0 Answers

2D looking 3D game 2 Answers

Convex Mesh Collider on Procedurally generated mesh does not conform.. 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