UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Add gravity to a model? (Make it fall to the ground)

broken avatar :(
Created 8 years ago
by Sxmplicity
0 Members and 1 Guest are viewing this topic.
1,337 views
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 28 September 2016
Last active: 7 years ago
Posts
1
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
×
Sxmplicity's Groups
Sxmplicity's Contact & Social Links
Hi!

So I am currently trying to work out how to make it so a script_model which I spawn via my GSC file can fall to the ground. At the moment I am spawning the model above the ground to allow it room to obviously fall down, but as you probably know when a model has an origin set, it will stick to that origin and float in the air. Is there a way to make it so the model's which I spawn fall to the ground instead of floating?

My code:
Code Snippet
Plaintext
function spawnStartingWeapons()
{
startWeap = GetEnt("weaponSpawner_1", "targetname");

for(guns = level.playerCount; guns > 0; guns--)
{
randomPosX = RandomIntRange(-150, 150);
randomPosY = RandomIntRange(-150, 150);
randomPosA = RandomIntRange(45, 120);
level.startWeaps[guns] = spawn("script_model", startWeap.origin + (randomPosX, randomPosY, 0));
level.startWeaps[guns] setModel("t6_wpn_pistol_m1911_world");
level.startWeaps[guns].angles = (0, 0, randomPosA);
}
}

And also another question (if you know it, that'll be great), I am unable to find any models which is a weapon model (as all the models I have copied the name from Radiant and put it in the script end up just being boxes?)

Thanks in advance!
broken avatar :(
×
broken avatar :(
Location: gbEurope
Date Registered: 20 September 2016
Last active: 2 years ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ulraz_viper's Groups
ulraz_viper's Contact & Social Links
You would maybe need to add a custom animation for this.. unless you set its final origin pos to the position laid on the ground

 
Loading ...