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 /
  • Help Room /
avatar image
0
Question by manhuntz111 · Aug 21, 2016 at 07:15 AM · animationrecttransformappcard

Rect transform question!! please help!!

Greetings everyone,

I am trying to make a app that has this card view like structure and a hamburger nav bar on the side. Now , i have a game object with several card like structures in it and they are far apart vertically . I want them to move to a specific POS Y position everytime i click from the side bar (nav bar) .

example : i click on home in nav bar , i want the specific card to come down . if i click settings , that card should come down. for that i need to access the POS Y anchored position of rect transform.

I want cards to move like how a one page parallax scroll would work in html5. Is there anyway to access the Pos Y of rect transform or animation from frame to frame. Thanks , please help :).

EDIT : User DiegoSLTS , solved it . Thankyou soo much!! :)

some Screenshots of app :

alt text

251.png (174.0 kB)
sadasdas.png (283.4 kB)
Comment
Add comment · Show 3
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 TrickyHandz · Aug 21, 2016 at 03:57 PM 1
Share

You may want to take a look at the Unity UI Extensions Project, it is found here: Unity UI Extensions on BitBucket. There is a couple of controls in that collection that allow for a scroll view to snap to a location. Specifically, the VerticalScrollSnap control should be able to handle exactly what you are trying to do, have a look and see if it might help: Vertical Scroll Snap Overview

avatar image manhuntz111 TrickyHandz · Aug 23, 2016 at 02:22 PM 0
Share

Thankyou so much for telling me this , Trickyhandz . I will try it out for sure . :)

So with this , if i press a button can i make one object lerp to another object and even scroll up and down and make those objects snap to the scene? :)

avatar image manhuntz111 TrickyHandz · Aug 23, 2016 at 02:50 PM 0
Share

Thankyou soo much . i saw this , it has really cool stuff and it has a native date picker too . I am loving it , thankyou soo much !! :)))

I saw that horizontal scroll snap and jump to i think that will solve my problem !!

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by DiegoSLTS · Aug 21, 2016 at 04:07 PM

https://docs.unity3d.com/ScriptReference/RectTransform-anchoredPosition.html

Note that anchoredPosition works as expected only for certain anchor modes, you might need to use sizeDelta too to get the proper y position of a RectTransform.

Comment
Add comment · Show 11 · 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 manhuntz111 · Aug 22, 2016 at 01:12 AM 0
Share

Thanks , is there a way to control the frames of animation like if i want to play from 5.0 to 8.0 and then after that i want to go from 3.0 to 1.0?

And with size delta i would be able to move the pos y of the rect transform??

Thankyou for reading. :)

avatar image DiegoSLTS manhuntz111 · Aug 22, 2016 at 01:33 AM 1
Share

You can move the y position of the rect transform just by setting a Vector2 to anchoredPosition, but that does what you want only for certain anchor modes (the ones that show the y position in the inspector). For other modes anchorPosition must be used in conjunction with RectTransform.sizeDelta and RectTransform.pivot, it's all explained in the docs.

As for your animation question, you should ask that as a new question, but I wouldn't even try that. Ins$$anonymous$$d of trying to execute parts of a big animation, split it into different animations (one with frames 5, 6, 7 and 8; another with frames 3, 2 and 1), since that's what you're actually doing, playing different animations.

avatar image manhuntz111 DiegoSLTS · Aug 22, 2016 at 06:19 AM 0
Share

Hi Diego , thanks for the answer.

I have a full game object in canvas which has child objects in it like in form of cards , i want them to move them up and down to a certain position like -1500 Pos Y or if i press another button it should go down like 500 Pos y and then another button i clicked on , it should go up to like -1000 pos Y. I only want to move the parent object which has these child objects. I want it to lerp from one card to another with pos y.

All i want to do is make a lerp effect , if you see the html5 one page scroll . You will understand what i want to make .

If nothing works i will just go for the enable and disable game object. :<

Thanks for reading. :)

Show more comments
Show more comments

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

123 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

Related Questions

Creating a dynamic animation system for a card game. 0 Answers

Is there an "IF" statement for "RectTransform"? 1 Answer

Animation not playing 0 Answers

Get and modify animation clip keyframes using a script? 0 Answers

Big sprite textures with animations appears distorted and flickers, only in build. 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