User Tag List

Results 1 to 6 of 6

Thread: Find position of click on terrain

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2016
    Posts
    374
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    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 As Collision Radius and Translation against node Bs mesh. If they collide, it is that node A has collided with node B, not the other way around. If node As collision Radius is equal to 0, then it cannot collide with node B. For node B to collide with A, it has to compare Bs Radius and Translation against As 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.
    taken from @ http://library.clickteam.com/firefly/frequently-asked-questions/

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2016
    Posts
    374
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    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. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I figured the position within the terrain itself would need to be calculated, but I'm not sure how to do that.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2016
    Posts
    374
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    send your latest mfa - i'll see why its moving the wrong verts

Similar Threads

  1. Replies: 6
    Last Post: 14th October 2016, 08:48 PM
  2. Replies: 2
    Last Post: 22nd June 2016, 12:54 PM
  3. Replies: 2
    Last Post: 27th November 2014, 03:11 PM
  4. find absolute x position?
    By Volnaiskra in forum Fusion 2.5
    Replies: 9
    Last Post: 9th October 2014, 08:19 AM

Posting Permissions

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