- Home /
Sprite tilts left/right depending on how far it is from the center [C#]
Trying to make a game which has the "Tinder RPG" genre made by Reigns where you swipe cards left or right and it tilts the card depending on how far it is from the middle. I've tried transform.rotatearound, but I think I'm not doing it correctly.
What I am trying to do is this effect, but left and right.
unityquestion.png
(78.2 kB)
Comment
Answer by knobblez · Dec 02, 2018 at 06:07 PM
You don't need to rotate it. You need to move it on the X axis.
What you are doing right now is rotating it around something. Sun around the moon
I'm guessing at your needs though. Need code
I got the moving the card on the X-Axis right just fine, what I don't know what to do is to tilt the card.
Your answer
![](https://koobas.hobune.stream/wayback/20220612183136im_/https://answers.unity.com/themes/thub/images/avi.jpg)