Yue Posted March 31, 2019 Author Share Posted March 31, 2019 I'm confused, the translator doesn't help much, the help says that the first three parameters are to apply force, the rest is the position of some entity, but this continues to release the box sometimes correctly and sometimes incorrectly. Quote Link to comment Share on other sites More sharing options...
Yue Posted March 31, 2019 Author Share Posted March 31, 2019 TEMP 31_03_2019 17_54_27.mp4 I don't really understand, I can't make it point to the right place. pick.entity:AddPointForce(self.entity:GetPosition(false), Vec3(0,0,550), true) Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted April 1, 2019 Share Posted April 1, 2019 You're adding a force in the Z direction. What you want is somthing like this; Float angle = player.rotation.y Float x = math.sin (angle) Float z = math.cos (angle) Addforce (position, vec3 (x, 0, z)) 1 1 Quote Link to comment Share on other sites More sharing options...
Yue Posted April 1, 2019 Author Share Posted April 1, 2019 No work. function Script:UpdateWorld() local mundo = World:GetCurrent() local ventana = Window:GetCurrent() local pick = PickInfo() col = mundo:Pick(self.player:GetPosition(true), Vec3(self.entity:GetPosition(true).x, self.entity:GetPosition(true).y,self.entity:GetPosition(true).z),pick, 0, false ) local anglePlayer = self.player:GetRotation(true).y local xP = Math:Sin(anglePlayer) local zP = Math:Sin(anglePlayer) if col then if pick.entity:GetKeyValue("name") == "Caja" then pick.entity:SetDamping(0,0) pick.entity:SetFriction(100,100) if ventana:KeyHit(Key.E ) then pick.entity:AddPointForce( pick.entity:GetPosition(), Vec3(xP,0,zP), true) --pick.entity:AddForce(Vec3(0,0,1000),false) --pick.entity:SetOmega(Vec3(0,0,0)) end end end System:Print(xP) Quote Link to comment Share on other sites More sharing options...
Josh Posted April 1, 2019 Share Posted April 1, 2019 local force = Vec3(0, 0, 1) force = Transform:Vector(force, self.entity, nil) pick.entity:AddPointForce(pick.entity:GetPosition(), force) 1 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...
Yue Posted April 1, 2019 Author Share Posted April 1, 2019 16 minutes ago, Josh said: local force = Vec3(0, 0, 1) force = Transform:Vector(force, self.entity, nil) pick.entity:AddPointForce(pick.entity:GetPosition(), force) Unbelievable, if it works, the most horrible confusion is that first goes Force and then position. That's what the help says. Today I will be able to sleep peacefully. Thanks You!! function Script:UpdateWorld() local mundo = World:GetCurrent() local ventana = Window:GetCurrent() local pick = PickInfo() col = mundo:Pick(self.player:GetPosition(true), Vec3(self.entity:GetPosition(true).x, self.entity:GetPosition(true).y,self.entity:GetPosition(true).z),pick, 0, false ) local force = Vec3(0, 500, -10500) force = Transform:Vector(force, self.player, nil) if col then if pick.entity:GetKeyValue("name") == "Caja" then pick.entity:SetDamping(0,0) pick.entity:SetFriction(100,100) if ventana:KeyHit(Key.E ) then pick.entity:AddPointForce( force,pick.entity:GetPosition(true)) end end end end Ok..mp4 Quote Link to comment Share on other sites More sharing options...
Josh Posted April 1, 2019 Share Posted April 1, 2019 It might make more sense to just use AddForce. I mean, the player just wants the box to go forward. They aren't going to be thinking about what point on the box they are kicking. 1 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...
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.