Well you'd need to persist it on spawning, using if(first()){Pos = entity():pos()}
Then, you'd need to subtract Pos from the entity's current position, Vec = Pos - entity():pos()
Then, applyForce(Vec + $Vec*5), to stabilise so you'd need to persist Vec as well.
If that fails, you'd need to multiply Vec by a number that varies on the entity's weight, but with chips I don't think that's needed.
Resulting in:
@persist Pos:vector Vec:vector
if(first()){Pos = entity():pos()}
interval(10)
Vec = Pos - entity():pos()
applyForce(Vec + $Vec*5)
Which should do fine, except bear in mind that chips generally spawn welded to a surface until you hit them with the physgun (Assuming they spawn on the world). In which case, the expression wouldn't move period from where it was spawned.


LinkBack URL
About LinkBacks






Reply With Quote



os()
Bookmarks