Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Sliding error

  1. #11
    Join Date
    Jul 2005
    Location
    Scotland
    Posts
    962
    here's the result of the lastest debug
    Transform Position: (-0.1, 0.9, 0.0) Char Control Position (-0.1, 0.9, 0.0)
    Hit Normal: 0, -1, 3.029463E-07. Hit Point: -0.1116695, 1.777469E-09, 0.005867275. Distance: 0.9149999

  2. #12
    Join Date
    Jul 2005
    Location
    Scotland
    Posts
    962
    OK with a lot of assistance from Crispie in IRC this evening we got this resolved.

    Basically I created the level in blender and the level was created z up, so to resolve I rotated floor plane 90 degrees and flipped the normals imported scene back into Unity and it's working a treat.

    A huge thanks and +rep for you Crispie

  3. #13
    Join Date
    Feb 2011
    Location
    Brisbane, Australia
    Posts
    71
    All good Stewart. Glad you got it all sorted, was driving me bonkers :-P

  4. #14
    Join Date
    Mar 2004
    Location
    South Australia
    Posts
    99
    Thank you crispie, after going through the code / videos 3 times. I found your helpful posts. My problem was a unity created capsule. Now he slides i can continue....
    Cheers

  5. #15
    Join Date
    Jul 2005
    Location
    Scotland
    Posts
    962
    Would I be correct in assuming that once I bring in the biped character Zak has kindly made available to Member sponsors, that would revert back to adding in Vextor3.up?
    Code:
    if (Physics.Raycast(transform.position + Vector3.up, Vector3.down, out hitInfo))

  6. #16
    Join Date
    Feb 2011
    Location
    Brisbane, Australia
    Posts
    71
    Stewart, more than likely. It all depends on where the character's pivot point is. If the character's pivot point is at the feet (which I think it is with Maya import's), then you will need to add the vector up. Don't forget, debug.log is your friend. Use it to find out where you are casting the ray from and how far it is traveling. If it isn't going to far before it collides with something, add the vector.up.

  7. #17
    Join Date
    Jan 2011
    Posts
    102
    I've just finished with the sliding video. I'm using the character Zak made and the level as well. The level didn't seem to come with the more slanted ramp on the side so I just duplicated the one next to it and rotated a bit to be as close to the video as possible. The video shows his capsule sliding smoothly, but mine is just being jerked to the bottom. It won't even slide on the other ramp that was already built in, no matter how high the Slide Threshold is. So I assume the problem is not the other ramp I made, and must be something I'm not taking into account with the character model?

  8. #18
    Join Date
    Feb 2011
    Location
    Brisbane, Australia
    Posts
    71
    Jim, I get the jerkiness as well. The only thing I can put it down to is that my character capsule is getting shunted in the direction of the ramp, then "falling" back down to the ramp, testing for a slide and getting shunted again. I haven't had too much time this week to play around with it, but I was looking at a way to move the player in the direction of the ramp or find out exactly what is going on. Will try and play around today and see.

  9. #19
    Join Date
    Jan 2011
    Posts
    102
    I've yet to find a fix for it, let you know if I do.

  10. #20
    Join Date
    Dec 2002
    Location
    Virginia Beach, VA
    Posts
    861
    Okay I'll go over this one more time. (As he sighs overly exasperatedly) The slide as implemented in the free training series is incredibly simple. It's purpose was to be simple in both design and explanation but good enough to cause the character to slide down the cliff faces that are in the 3rd Person Platform game and it does rather convincingly job of it to for only a couple lines of code. It was never meant to be a sliding down a slope of ice type effect. For that both the technique and the math get a bit more complicated. Which was something we did not want to have to try and explain in these very introductory videos. We figured the camera system itself would present enough challenge for beginners without diving into linear algebra and obscure parts of the Unity scripting api to get a true slide. That is something that is being reserved for those in the MMO class.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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