Announcement

Collapse
No announcement yet.

How to use "get location at spline point" ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to use "get location at spline point" ?

    Hello,

    I'm trying to create a simple ladder system that uses a spline component. The spline has 2 points, on starting point and one end point. However I can't seem to get the relative location of said points. No matter what index I use I always get the location of 0,0,0 (relative location)

    What am I doing wrong?


    Last edited by WixZ; 12-04-2017, 11:13 AM.

    #2
    Ok I found out what thye problem is and it's really obvious. However I'm still in need of some help as I suck at math. So basically the issue is because the points return a local coordinate and then using that coordinate to set the player position which is wrong of course. But how can I convert the world space location of a point so that I can then set my player location's local location to that point?

    I think I have to do some kind of conversion from world to local space or something, but not sure how to do that.

    Comment


      #3
      Ok I managed to do this without a spline. I just use a start and end point (2 vectors) and then I just calculate the difference between their 2 relative location, multiply that by a ladder progress float which defines where the player is on the ladder (pressing up increases value, pressing down decreases value) clamped between 0 and 1. Then I just multiply ladder progress value with the difference between the two location and add that to the lowest location and use that as relative location for my player location. Works as it should.

      Last edited by WixZ; 12-04-2017, 04:16 PM.

      Comment

      Working...
      X