Jump to content

setElementVelocity


DakiLLa

Recommended Posts

hi. one problem with setting velocity. I want to push off player if he hits a marker but i have no result. What's wrong or setElementVelocity cant set other speeds without Z-speed ?

marker = createMarker ( 768.1605, -37.0261, 1000.6464, "cylinder", 9.0, 255, 150, 0, 150 ) 
  
function onMarkerHit ( thePlayer, matchingDimension ) 
    if source == marker then 
        setElementVelocity ( thePlayer, 0, -0.9, 0.0 ) 
    end 
end 
addEventHandler ( "onMarkerHit", marker, onMarkerHit ) 

Link to comment

I know for sure that setElementVelocity works for all 3 axis'. I made a really n00bish version of cruise control with it and drove with it very "smootly"! ^^

Anyway, I wouldn't recommend...

if source == marker then 

...because it only gets triggered if the source is marker. :P

But can you put things like:

marker = createMarker ( 768.1605, -37.0261, 1000.6464, "cylinder", 9.0, 255, 150, 0, 150 ) 
   
function onMarkerHit ( thePlayer, matchingDimension ) 
    outputChatBox("A") 
    if source == marker then 
        outputChatBox("B") 
        setElementVelocity ( thePlayer, 0, -0.9, 0.0 ) 
    end 
end 
addEventHandler ( "onMarkerHit", marker, onMarkerHit ) 

? That would make it much simpler to see where the problem lies. ;)

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...