September 2010
Beginner
384 pages
8h 49m
English
These are the two lines from our code we'd like to better understand:
var target = Quaternion.Euler (tiltAroundX, 0, tiltAroundZ); // Dampen towards the target rotation transform.rotation = Quaternion.Slerp(transform.rotation, target,Time.deltaTime * smooth);
Let's actually start from the bottom up.
In the final line of code, we're setting transform.rotation to something, which will turn the paddle somehow. That much, we get. We can probably also guess that Quaternion is one of those built-in classes that we looked at, like Input both Quaternion and Input start with a capital letter, and light up when we type them.
Slerp sounds weird, but it starts with a capital letter and has round brackets next to it. We've seen that same structure ...
Read now
Unlock full access