• Magnetic constraint
    8 replies, posted
How does magnetic tool work? I mean: How does magnetic tool know that two entities had just touched? I'm trying to make a tool that applies constraint.Weld when two entities touch (like magnetic tool works I believe) but I don't know how to trigger that two entities touched together.
[url=http://bananatree.im/wiki/wiki.garrysmod.com/index8483.html?title=Gamemode.ShouldCollide][img]http://puu.sh/ftRA[/img][/url]
[QUOTE=Hyper Iguana;34516303][url=http://bananatree.im/wiki/wiki.garrysmod.com/index8483.html?title=Gamemode.ShouldCollide][img]http://puu.sh/ftRA[/img][/url][/QUOTE] GOD, thank you. EDIT: Isn't what I wanted.
Wiki said: This hook is not called right before two entities collide, but simply to poll if they should collide when they are about to touch each other. I need to know when they are going to collide, not when they are near (what is happening).
[lua]function ENT:PhysicsCollide(data, phys)[/lua] This function is not in the wiki. It should be declared shared, as far as I know. Look at Mad Cow's Realistic CS:S weapons. You'll be interested in the incendiary grenade.
But this is used to make a SENT, and I want to magnet two entities without the need of being scripted entities, like magnetic tool does.
[QUOTE=lilezek;34572152]But this is used to make a SENT, and I want to magnet two entities without the need of being scripted entities, like magnetic tool does.[/QUOTE] The tool just replaces the selected entities, with phys_magnet entities.
Magnets have never worked for me. Didn't know that they ever did for anyone else.
[QUOTE=_NewBee;34590089]Magnets have never worked for me. Didn't know that they ever did for anyone else.[/QUOTE] If two magnetised ents touch, they weld. Nothing else.
Sorry, you need to Log In to post a reply to this thread.