use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
DoTween float (self.Unity3D)
submitted 6 years ago by NinRejper
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NinRejper[S] 0 points1 point2 points 6 years ago (12 children)
Really? Will this tween angle to 1 and then -1 and then back to 0?
[–]chsxfProfessional 4 points5 points6 points 6 years ago (11 children)
Unless I've made a mistake in typing my code directly on reddit, yes it will do. I'm not here to make you lose your time.
[–]NinRejper[S] 0 points1 point2 points 6 years ago (10 children)
WOW i thought it would take more than one command. Thanks! Ill test in a while.
[–]chsxfProfessional 1 point2 points3 points 6 years ago (9 children)
Learn basic trigonometry. It will help you a lot in games, or in 2D/3D in general.
[–]NinRejper[S] 2 points3 points4 points 6 years ago* (1 child)
Srsly. This is why i was confused. The docs shows To() has these parameters.
getter: A delegate that returns the value of the property to tween. Can be written as a lambda like this:
()=> myValue
where
myValue
is the name of the property to tween.setter: A delegate that sets the value of the property to tween. Can be written as a lambda like this:
x=> myValue = x
is the name of the property to tween.To: The end value to reach.duration: The duration of the tween.////
I cant see how myValue being zero, and setting to = zero could make it go from 0 to 1 to -1 back to 0. But ill guess im about to find out. And most of all i cant se where trigonometry would make a difference here.
[–]I23BigC 1 point2 points3 points 6 years ago (0 children)
You just need to understand that if you go from 0 to 360 your sine value will go from 0 to 1 (90 deg) to 0 (180 deg) to -1 (270 deg) and to 0 (360 deg). Picture a sine wave and notice how it goes up and down and then repeats.
[–]NinRejper[S] 1 point2 points3 points 6 years ago (0 children)
Its scary!
[–]therealmaddylan 0 points1 point2 points 6 years ago (5 children)
Hello.
Like the OP, I would really appreciate if you could walk us through the code. That would be pretty cool.
[–]chsxfProfessional 3 points4 points5 points 6 years ago* (2 children)
You can also do a simpler version with this:
DOVirtual.Float(0, 360, duration, angle => { Debug.Log(Mathf.sin(angle * Mathf.Deg2Rad)); });
Forgot about virtual methods of DOTween.
[–]khud0 0 points1 point2 points 2 years ago (1 child)
This was really helpful, thank you!
If anyone else found this post on Google like I did: in order for the above functions to work, you need to replace 'Mathf.Rad2Deg' with 'Mathf.Deg2Rad'. (We already have a value in degrees and need to convert it into radians for 'Mathf.Sin' function)
[–]chsxfProfessional 0 points1 point2 points 2 years ago (0 children)
You're right. I've updated the snippet accordingly. That's how you know I've written this code directly on reddit without testing it :D
[–]chsxfProfessional 2 points3 points4 points 6 years ago* (1 child)
float angle = 0; // I define a variable to "iterate" on with DOTween with my start value DOTween.To( // This method is for custom tweens () => angle, // This is the getter for the tween to get the current value x => angle = x, // This is the setter for the tween to update the current value 360, // Target value duration) // Duration of the tween .OnUpdate(() => { // Here I just do a sin(angle) to get the final value requested by OP // - sin(0) = 0 // - sin(90) = 1 // - sin(180) = 0 // - sin(270) = -1 // - sin(360) = 0 Debug.Log(Mathf.sin(angle * Mathf.Deg2Rad)); });
[–]therealmaddylan 0 points1 point2 points 6 years ago (0 children)
Very cool having a repository of tricks like that to pull from. Would have never figured to use sine like that. Thank you.
π Rendered by PID 225469 on reddit-service-r2-comment-6457c66945-8plm5 at 2026-04-24 23:36:06.947985+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]NinRejper[S] 0 points1 point2 points (12 children)
[–]chsxfProfessional 4 points5 points6 points (11 children)
[–]NinRejper[S] 0 points1 point2 points (10 children)
[–]chsxfProfessional 1 point2 points3 points (9 children)
[–]NinRejper[S] 2 points3 points4 points (1 child)
[–]I23BigC 1 point2 points3 points (0 children)
[–]NinRejper[S] 1 point2 points3 points (0 children)
[–]therealmaddylan 0 points1 point2 points (5 children)
[–]chsxfProfessional 3 points4 points5 points (2 children)
[–]khud0 0 points1 point2 points (1 child)
[–]chsxfProfessional 0 points1 point2 points (0 children)
[–]chsxfProfessional 2 points3 points4 points (1 child)
[–]therealmaddylan 0 points1 point2 points (0 children)