# Thread: Find position of click on terrain

1. ## Find position of click on terrain

Hi,

How can I find where the user clicked on a terrain?

What I'm doing doesn't work, but then again, I have no clue what I'm doing: TerrainClick.mfa

2. try turning collision on the terrain..(but no colsphere) - the mousepick cant collide with it if it cant be collided with.

How Do Collisions work ?
Collisions work like this: When node A (that Uses Collisions) might collide with node B (that Uses Collisions, it compares node A’s Collision Radius and Translation against node B’s mesh. If they collide, it is that node A has collided with node B, not the other way around. If node A’s collision Radius is equal to 0, then it cannot collide with node B. For node B to collide with A, it has to compare B’s Radius and Translation against A’s mesh.

In short if you are checking something hit something else the first thing needs a radius the second thing doesnt but does need collision turned on.

3. Thanks. That works for positioning the sphere where the mouse was clicked.

I'm trying to change the terrain height where the mouse was clicked, but setting the relative Y vertex at that position results in it changing elsewhere. Are the coordinates within the terrain different somehow? I tried adding the position of the terrain to the picked coordinates, but that didn't help.

4. i havent tested it yet - but you will to offset the origin as you need the x,y of the terrain not the x,y of the world.

5. Yeah, I figured the position within the terrain itself would need to be calculated, but I'm not sure how to do that.

6. send your latest mfa - i'll see why its moving the wrong verts

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•