aarrowh Posted January 21, 2014 Share Posted January 21, 2014 I'm testing out different types of physics pads (Jump pads, boost pads) I've found a couple odd things. 1. When you use a jump pad and hit the bottom of a brush my controller(FPS prefab) goes straight through and lands on the top 2. when using a force based boost pad, going any direction other than straight will instantly kill you. Both pads are based on the JumpPads tutorial. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 21, 2014 Share Posted January 21, 2014 Could you post a map and minimal example and code for us to test please ? Perhaps you have wrong physic settings what can happen also ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 *edit* it says I'm not permitted to upload .map files Script.JumpForce = nil --vec3 "Jump Force" Script.SelectiveCollision = false --bool "Selective Collision" Script.ColObj = nil --Entity "Collision Object" Script.Active = false --bool "Active" function Script:Start() end function Script:Enable() if self.Active == false then self.Active = true end end function Script:Disable() if self.Active == true then self.Active = false end end function Script:Collision(entity, position, normal, speed) if (self.SelectiveCollision == true and entity == self.ColObj ) then self.ColObj:AddForce(self.JumpForce) elseif (self.SelectiveCollision == false) then entity:AddForce(self.JumpForce) end end That is my jumppad script Both brushes of ground are set to rigid body and scene. Quote Link to comment Share on other sites More sharing options...
beo6 Posted January 22, 2014 Share Posted January 22, 2014 (edited) Well. at least point 2 makes sence because if you look into the script you will see this part: function Script:Collision(entity,position,normal,speed) if speed>20 then self:Hurt(100) end end which means that if the character collides with something at a speed greater 20 you will be killed instantly. Edit: i of course mean the FPSPlayer.lua script Edited January 22, 2014 by beo6 Quote Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 Well. at least point 2 makes sence because if you look into the script you will see this part: function Script:Collision(entity,position,normal,speed) if speed>20 then self:Hurt(100) end end which means that if the character collides with something at a speed greater 20 you will be killed instantly. But if I'm still on top of the same brush I'm not colliding with anything new, and that also wouldn't explain why getting pushed straight is ok but not a different direction. Quote Link to comment Share on other sites More sharing options...
beo6 Posted January 22, 2014 Share Posted January 22, 2014 i don't know your exact level build but you don't need to collide with anything new because collision is called i guess every frame or so when you collide with anything other then a Trigger. Do you still get killed if you comment the line "self:Hurt(100)" out? Quote Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 No I don't get hurt anymore(After commenting force dmg out). I just don't understand why going straight won't kill be but sideways will. Quote Link to comment Share on other sites More sharing options...
beo6 Posted January 22, 2014 Share Posted January 22, 2014 i am not sure. That would require a bit of try and error. My first guess is that it possibly collides again with the Trigger object. Try this to have Triggers not kill your character: (not tested code) function Script:Collision(entity,position,normal,speed) if speed>20 and entity:GetCollisionType()~=Collision.Trigger then self:Hurt(100) end end Quote Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 i am not sure. That would require a bit of try and error. My first guess is that it possibly collides again with the Trigger object. Try this to have Triggers not kill your character: (not tested code) function Script:Collision(entity,position,normal,speed) if speed>20 and entity:GetCollisionType()~=Collision.Trigger then self:Hurt(100) end end This didn't work, i tried playing with it a bit, and still nothing. But I did notice that it is still killing me even if the force is set under 20 Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 22, 2014 Share Posted January 22, 2014 Could you take a screenshot of the level and paint over to pt some text and say who BSP block uses what script ? I think your problem is relative to collision management in some strange way, or not in better working one. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 Attached is the screenshot of the map, with current physics settings labeled for each brush. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 22, 2014 Share Posted January 22, 2014 Your problem could be BSP or physics on BSP, i played a good bunch with BSP , models and physics and there are some serious physic bugs. Perhaps you are in one of these physics problem ? ok so how does game works ? you walk on yellow area and your character jumps ? on grey area nothing special just a walkable surface ? is there any danger area ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 Exactly. Hit yellow and you should jump up and into the blue. Grey is just for walking around. I expected with a jump force of 600 that hitting the blue would instantly kill me(My goal). Instead, I fly straight through and into the sky beyond. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted January 22, 2014 Share Posted January 22, 2014 The force is perhaps too high also : I made some F-Zero style prototype using BSP cubes, and i got the bsp cube vehicle passing throught level caus of velocity. Why not : reducing force and just detect blue collision ? or use : PhysicsSetPosition to manually make the player fly vertical to blue until it collides with blue volume ? OR use raycast above player head to detect the Y possible collision , and after yellow jump, make it jump until it reaches the players head , you could make it jump until it reaches or have a great Y value than Y collision reported by raycast. This way, you could use any velocity. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
aarrowh Posted January 22, 2014 Author Share Posted January 22, 2014 The only solution that I have thought of is your second option. Because after lowering the force on the jump to where I don't pass straight through, I'm no longer travelling at a velocity that is strong enough to cause dmg. 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.