Moving player to generated position

I am fairly new to Unity, but I have gotten a fairly decent grip on the whole coding aspect. I have been cruising along the development of my game but I just simply can’t get my player script to work properly. I’ve looked all over and I might just be ignorant, but I cannot find anything that fits what I am trying to do.

Movement I am trying to do: I have a generating set of game objects, and I want the player to appear that he is “Jumping” to the position (but this isn’t a physics related came, so I am not using any rigid bodies). Basically what I want to do is get Player from Object1 (initial object) to Object1 (generated, but in a new position) by clicking. I do not want the jump to to happen if the player has not clicked the general area of the box collider.

I hope I provided a fairly detailed description.

Here is the code I currently have for my playerscript (I borrowed it off of a tutorial and changed a good bit of it, so you will see some “hints”)
Branch1 = Game Object

using UnityEngine;
using System.Collections;

public class PlayerScript : MonoBehaviour
{

	public float speed = 1.5f;
	public Vector2 branch1;
	private Vector2 target;

	void Start()
	{

		target = transform.position; //gameobjects position before moving
		branch1 = GameObject.Find("branch1").transform.position;

	}
	void Update()
	{

		if (Input.GetMouseButtonDown(0)) //if user clicked somewhere on the screen

		{


			target = Camera.main.ScreenToWorldPoint(Input.mousePosition); //target (click) position

		}
			
		transform.position = Vector2.MoveTowards(transform.position, target, speed * Time.deltaTime);


	}

}

You want to player to move to the mouse click point, only if you clicked within a collider?
If so, you can a) use Physics2D.RayCast, b) add a component to the Collider with a OnMouseDown method that’ll have to send the click position to the player script.

Ok, even though i’m fairly new my self I will explain how to do that(probably)

Have your game generate the object and make sure the prefab for the object has a tag like “newPosition”
or something along those lines

do something along the lines of this

private GameObject newPosition
public GameObject Player

//^ put these variables before the functions

public void InsertThisInsideYourGenerationScript()
{
//blah blah blah generation script blah blah blah
//Then once your object gets generates
 newPosition = GameObject.FindGameObjectWithTag("Newposition");
}

private void Update()
{
if(newPosition = !null)
{
if(Vector3.Distance(Player.transform.position, newPosition.transform.position) <= 0.1)
{
//Now if you what to have your object teleport to their location replace Slerp with transform.position = newPosition

transform.position = Vector3.Slerp(transform.position, newPosition, SpeedOfMovement * Time.deltatime);
}
}
}