- Home /
Inertia Scrolling Touch
Hello, I have a background plane texture and a Camera on my scene. I have put a simple code found on the web to move my camera with the touch screen.
public class test : MonoBehaviour {
void Update () { // Only if there are touches if (Input.touches.Length == 1) { // Only work with the first touch // and only if the touch moved since last update if (Input.touches[0].phase == TouchPhase.Moved) { //float x = Input.touches[0].deltaPosition.x SmoothTime Time.deltaTime; float y = Input.touches[0].deltaPosition.y 2 Time.deltaTime; transform.Translate(new Vector3(0, -y, 0)); } } } }
Someone knows how to add a simple inertia/smooth effect? I have found some examples on the internet but they were a bit complicated for me (and linked to GUI so it's not my case).
If someone can drop me an example of code to use or an hint to progress, it will be very helpful :)
@v75273278 Yes, i need help! Omg, i need Inertia Scrolling...
Answer by v75273278 · Apr 09, 2013 at 10:11 AM
do you still need help with this?
yes. I think its not personal chat, 10 people follow this thread waiting for an answer. so if you have an answer, please share :)
Your answer
Follow this Question
Related Questions
Touch stopped working, works in remote 2 Answers
Different animations on mobile 0 Answers
scrollrect jump to screen 0 Answers
Mobile FPC in unity 5 1 Answer
Mobile Graphics Settings in Menu 1 Answer