Jump to content

Object with projectile motion


-Blaze-

Recommended Posts

That'll require quite some math since there are no default functions for that. You would need some math about the force which is being used to throw the object, you need to calculate the angle, the speed and by taking the total distance you would be able to update the position from the object. It's seriously a pain in the ass so if you question was if there was a default function for that; no, I'm sorry. You can however let the user throw a nade and not make it explode + attach an object to it.

Link to comment

@tosfera , that could work, i tried this code >

  
function shootProjectile() 
        local x, y, z = getElementPosition(localPlayer) 
        local nade =  createProjectile(localPlayer, 16, x, y, z) 
        local myobject = createObject ( 1369, 0, 0, 0) 
        attachElements( myobject, nade) 
         
end 
  
bindKey("mouse1", "down", shootProjectile) 
  

However , the object doesn't attach to the projectile , also there aren't any errors in debugscript.

Also , how can i disable the explosion of the projectile?

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