Jump to content

How to attach players to vehicles...


The_Stig

Recommended Posts

It still seemed wrong even in that case when I used it.

Like say you jumped on the front of the car it'd glue you a metre off the left of it or something similar. I fixed it by changing the math used but it's strange no-one else has mentioned it.

could you post the fixed function so others can update their scripts please? :P

Link to comment
local vrZ = math.rad(360 - vrZ) 
local offsetZ = pZ-vZ               
local offsetX = math.cos(vrZ)*(pX-vX) - math.sin(vrZ)*(pY-vY)  
local offsetY = math.sin(vrZ)*(pX-vX) + math.cos(vrZ)*(pY-vY) 

That works exactly as far as I've seen. Don't expect me to explain it to you :P

If anyone has managed to produce some method of allowing the player to move while on the vehicle without them being thrown off it I'd appreciate a look.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...