move towards target unity
//This will work for 2d or 3d platforms
//Make sure to call in Update or else it wont work
Vector3.MoveTowards(transform.position, taretPos, Qiaternion.identiy)/// <summary>
/// Move 2D sprite towards target
/// </summary>
/// <param name="target"></param>
/// <param name="movementSpeed"></param>
private void Move(Vector3 target, float movementSpeed)
{
//Move
transform.position += (target - transform.position).normalized * movementSpeed * Time.deltaTime;
}
Also in C#:
- null coalesce ternary c#
- transform object according to its parent unity
- how to change text to bold through script unity
- c# windows grab screenshot
- unity list length
- c# max sequence contains no elements
- unity how to rotate something to point to something else
- unity how to make a ui disappear
- add row count devepxress report
- unity onclick object
- convert string array to int C#
- How to get the world position of the edge of an object?
- c# multiple catch exceptions
- same click event diffrenet buttonms c#
- unity rigidbody constraints
- functions unity
- asp.net core mvc not triggering client side validation
- s3 upload base64 .net core
- c# anonymous class
- .net core copy file in folder to root
- .netstandard distinctby iqueryable
- c# param exception
- move file from one folder to another c#
- c# return multiple value unity