TEPA6ANT Posted May 11, 2019 Share Posted May 11, 2019 I'm trying to make a conveyor. But faced a problem. function Script:Collision(entity, position, normal, speed) if self.active then entity:SetVelocity(self.speed) --self.speed=Vec3(5,0,0) end end It seems to work. But when the object goes in the opposite direction, its speed is the same as if it did not go on conveyor. I tried using AddForce. But it is too fast (values below 0.04 (self.speed=Vec3(0.04,0,0)) do not move the object, and above is very fast). Quote Link to comment Share on other sites More sharing options...
TEPA6ANT Posted May 11, 2019 Author Share Posted May 11, 2019 It turned out the problem in speed. Replaced self.speed=Vec3(5,0,0) on self.speed=Vec3(3(or below),0,0). And somehow the problem disappeared. How to delete a post? 1 Quote Link to comment Share on other sites More sharing options...
TEPA6ANT Posted May 12, 2019 Author Share Posted May 12, 2019 However, not everything works so well. The speed of objects with different Physical Mode on conveyor are always different (Rigid Body goes faster than the Character Controller). How can they be equated? And another question. How to load a brush entity shader? (just... local mat = self.entity:GetMaterial() mat:SetShader(self.shader) --attempt to index local 'mat' (a nil value) ) This is necessary to make the texture move. Quote Link to comment Share on other sites More sharing options...
Slastraf Posted May 13, 2019 Share Posted May 13, 2019 maybe the character controller and other object have different mass to them.. Try using physicsSetPosition in a loop . Or divide force by mass or something. For the shader thing, please explain better what u need, it probably dont need to be scripted. Check out firepit addon in workshop for animated sprite texture Quote Link to comment Share on other sites More sharing options...
TEPA6ANT Posted May 14, 2019 Author Share Posted May 14, 2019 Quote maybe the character controller and other object have different mass to them No. I changed mass of objects, result is same. I need this to be independent of the mass. Quote physicsSetPosition I'm honest. Didn't know. But I tried, the result is not what you need. Object with a Rigid Body, flew somewhere, and with Character Controller stands still. Quote For the shader thing, please explain better what u need, it probably dont need to be scripted. Check out firepit addon in workshop for animated sprite texture I just need the texture on the brush to move at the right speed. As in Half-Life for example. In entity script, set speed and direction of the texture for shader. But, as I understand it, the texture of the brush is not so easy to take. (self.entity:GetMaterial() == nil). P.S. My English is bad and i'm partly using Google Translate for writing post. (<- Этот текст я написал без использования переводчика) Quote Link to comment Share on other sites More sharing options...
Slastraf Posted May 14, 2019 Share Posted May 14, 2019 you can make animated textures in leadwerks, use the shader from the firepit addon or if you have your own one. But you would need a n*n spritesheet Quote Link to comment Share on other sites More sharing options...
TEPA6ANT Posted May 14, 2019 Author Share Posted May 14, 2019 3 hours ago, Slastraf said: you can make animated textures in leadwerks, use the shader from the firepit addon or if you have your own one. But you would need a n*n spritesheet I don't need a sprite. I need to move the texture on brush. Just move, I can using shaders. But, using the script, get material, and then set shader for material, this fails. And to solve the second problem, I just need to learn how to get material from brush(Box,Wedge,Sphere etc.). 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.