YouGroove Posted February 5, 2014 Share Posted February 5, 2014 How to have arms and gun not go throuht walls ? I sue character controller and don't want to make character too tiny ? Or don't i have choice and include whole character in char physics cylinder ? (So rescale ennemies , textures ... all down) If i include Whole character in the char phys cylinder by scaling it down the new problem is that the height of cylinder is too big : bad as i plan aerial ennemies and passing under structures Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted February 5, 2014 Share Posted February 5, 2014 One idea that someone implemented was to do a ray cast and when the gun in a case like this would go through a wall, they would lower the gun down with an animation. With this model I blend the idle on upper to the walk animation so the gun stays down at the side to avoid this. If shooting we can do the raycast trick to stop shooting and return gun to the sides. 2 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 5, 2014 Share Posted February 5, 2014 Or the material of the weapon can drawn in front of the level Quote Link to comment Share on other sites More sharing options...
Rick Posted February 5, 2014 Share Posted February 5, 2014 I think that works in first person perspective but in the case he has shown here it would look funny I think because when viewed from the top it breaks what we expect from 3D. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 5, 2014 Share Posted February 5, 2014 Rick's suggestion is good. I've seen this done in a few games. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Patrik Posted February 7, 2014 Share Posted February 7, 2014 I also did it the way Rick mentioned. Doing an raycast to check if the gun is going inside the wall and if it does point the gun at the ground instead. Effect can be seen in this video: http://www.leadwerks.com/werkspace/page/videos/_/-r169 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 7, 2014 Author Share Posted February 7, 2014 Great. Ok just taken Lua Pick collision example : if self.world:Pick(Hightint, LowPoint, pickInfo, pickRadius) then visible = false sphere:SetPosition(pickInfo.position) if pickInfo.entity:GetKeyName(0) == "Icecream" then --if(pickInfo.entity:GetKeyValue("Icecream") == "Chocolate") pickInfo.entity:Turn(0,0,0.5 * Time:GetSpeed()) end else sphere:SetPosition(-3,1,0) end The problem is this examples are in App.lua, I need the World reference for my TPS.lua script, how to call World object from Lua to be able to use Raycast ? I think in calling Raycast in the Hand of the character with as Y values : Max Y player and Min Y Player How to get Min and Max Y values of player ? (For min i think i can use GetPosition()) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted February 7, 2014 Share Posted February 7, 2014 The problem is this examples are in App.lua, I need the World reference for my TPS.lua script, how to call World object from Lua to be able to use Raycast ? The App object is global so you can do App.world anywhere and get the world. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.