DakiLLa Posted November 17, 2008 Posted November 17, 2008 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 )
Mr.Hankey Posted November 17, 2008 Posted November 17, 2008 Write a debug ouput inside the "if source == marker then" check to make sure it reaches the part where the velocity is set. It's definatly working without setting a velocity along the Z-axis.
DiSaMe Posted November 17, 2008 Posted November 17, 2008 Maybe it's because player is on the ground, GTA map object?
Gamesnert Posted November 17, 2008 Posted November 17, 2008 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. 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now