Raised This Month: $32 Target: $400
 8% 

Projectile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
safetymoose
Senior Member
Join Date: Feb 2015
Old 07-04-2015 , 07:36   Projectile
Reply With Quote #1

How can make a projectile entity move like in a parabolic trajectory. Like for example when you throw a grenade, it's launched forward but it falls to the ground.

I need to launch a projectile at an upward angle, then it will move in a parabol until it hits the ground. Any ideas?
safetymoose is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-05-2015 , 11:40   Re: Projectile
Reply With Quote #2

well, from what i know you have to find a way to set gravity for entity.
but i dont know exactly how...

Last edited by Depresie; 07-05-2015 at 11:42.
Depresie is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-05-2015 , 11:46   Re: Projectile
Reply With Quote #3

I believe you can execute
PHP Code:
set_pev(pEntitypev_gravity1.0); // or whichever value 
on an entity that has movetype set to MOVETYPE_TOSS, ie
PHP Code:
set_pev(pEntitypev_movetypeMOVETYPE_TOSS); 
and its movement should be affected by gravity.
klippy is offline
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 07-05-2015 , 17:22   Re: Projectile
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
I believe you can execute
PHP Code:
set_pev(pEntitypev_gravity1.0); // or whichever value 
on an entity that has movetype set to MOVETYPE_TOSS, ie
PHP Code:
set_pev(pEntitypev_movetypeMOVETYPE_TOSS); 
and its movement should be affected by gravity.

I haven't tested but I think you are right. Once you do the above, remember to set the velocity in the direction you want. Let us know if it doesn't work
vitorrossi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode