Add 2D Follow Script
See original GitHub issueFollow Utility.
We should be able to attach it to any object that we want follows another object.
This follow script can have these settings:
- offset (Vector3): The position offset for the follower.
- followType (Enum): MoveTowards, Lerp, SmoothDamp and Acceleration Enum, Also each follow type has it’s own settings.
public enum FollowType {
MoveTowards,
Lerp,
Slerp,
SmoothDamp,
Acceleration
}
- speed (You can use it where you need it): The speed of the follower.
- time (You can use it where you need it for Lerp, MoveTowards, …): The time for movement, Also you can use it as smooth time for SmoothDamp.
- bounds (Bounds, BoxCollider2D, Vector2, …): Can be anything, a width and height or a box collider 2d or an bounds class, also there should be an option to disable it.
EDIT: Acceleration movement http://answers.unity3d.com/answers/29757/view.html
Any more suggestions are welcome. 😄
Looking for Rigidbody2D follow script? Find it at #13
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
unity 2d camera follow script, add this ...
unity 2d camera follow script, add this script to camera and drag character or your object into it. simple! - unity 2d camera...
Read more >Unity 2D Platformer Tutorial 18 - Making the camera follow the ...
This video demonstrates how to write a script to make the camera follow the player in a 2D platformer game in Unity. Code...
Read more >Make a Unity 2D Camera Follow Player in 15 seconds
In this 15 second Unity tutorial, we cover how to make a unity 2d camera follow player. ▻ Socials Twitter: https://twitter.com/the_real_aia ...
Read more >How to Add a 2D Follow Camera in Unity 2022 - YouTube
Quick updated guide on how to setup a camera that follows your player around the screen and sets up pixel perfect camera with...
Read more >Unity 2D Platformer Tutorial 7 - YouTube
Unity 2D Platformer Tutorial 7 - How To Create 2D Smooth Camera Follow Script For Your Player · Comments321.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Acceleration follow means the object increases speed over time. Gradually moving an object.
Here is a nice resource: http://answers.unity3d.com/answers/29757/view.html
Resource Added to issue.
Thanks.
Sounds like a fun thing to check, I’ll give it a try today.