Jump to content

Best collision solution


YouGroove
 Share

Recommended Posts

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)

 

problem.jpg

 

 

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

 

problem2.jpg

Stop toying and make games

Link to comment
Share on other sites

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.

  • Upvote 2
Link to comment
Share on other sites

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())

Stop toying and make games

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...