Volgera Posted May 18, 2015 Share Posted May 18, 2015 is it possible? I've never really paid attention to it, but I'm trying to make a weapon where an enemy is being 'pushed' or 'thrown' away whenever the player hits the enemy. Link to comment Share on other sites More sharing options...
Seiai Posted May 18, 2015 Share Posted May 18, 2015 @Volgera,target.Physics:SetMotorVelOverride(20,0,0) target:DoTaskInTime(5,function(target)target.Physics:ClearMotorVelOverride() end)well, this works to push stuff around unless its trying to move by itself, so u probably have to do something, to prevent it from moving by itself(probably something in the locomotorcomponent, i tried a few things but didnt find anything that works). But shooting off birds in a direction works pretty good with it so far(i bound it to a hotkey to target the thing under my mouse)^^ Link to comment Share on other sites More sharing options...
Volgera Posted May 19, 2015 Author Share Posted May 19, 2015 all right I'll be able to try and mess around to see if I can get something working then Link to comment Share on other sites More sharing options...
Volgera Posted May 19, 2015 Author Share Posted May 19, 2015 I'm just not sure how the locomotor works exactly... does anyone know how I can make an enemy stop moving on hit ? Link to comment Share on other sites More sharing options...
Mobbstar Posted May 19, 2015 Share Posted May 19, 2015 I'm just not sure how the locomotor works exactly... does anyone know how I can make an enemy stop moving on hit ? You can stop their brain to prevent new paths from being taken. I don't know how to clear the cache though... Link to comment Share on other sites More sharing options...
Seiai Posted May 19, 2015 Share Posted May 19, 2015 @Volgera,if u dont mind it being instant, u could also just teleport it:target.Physics:Teleport(newposition)ortarget.Transform:SetPosition(newposition) Link to comment Share on other sites More sharing options...
Volgera Posted May 20, 2015 Author Share Posted May 20, 2015 teleporting wouldn't give the 'fun' of hitting them with a baseball bat and seeing them get smashed away I've also noticed this 'pushing away' effect hasn't at all been used by klei in the game... even the exploding gundpowder doesn't have a blast radius or sth Link to comment Share on other sites More sharing options...
Seiai Posted May 20, 2015 Share Posted May 20, 2015 I've also noticed this 'pushing away' effect hasn't at all been used by klei in the game... even the exploding gundpowder doesn't have a blast radius or sththen use a better searchfunction, it's used a lot i would suggest the "search in files" function in notepad++ with the filter *.lua and the data-folder of the game.iam not sure how gunpowder pushes stuff, but i think it's this:inst.Transform:SetFromProxy(proxy.GUID)u could also try around with the collisionphysics and have stuff "collide" away from your character by making his collisionphysics bigger (just search for physic with notepad++). Link to comment Share on other sites More sharing options...
Volgera Posted May 20, 2015 Author Share Posted May 20, 2015 oh! in that case I'll go have a look around and see if I can do something neat with it! thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.