Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Posts posted by shadmar

  1. something like this would do the trick:

     

    In Start():
    lasttime=0
    
    In Loop():
    if Time:GetCurrent()-5000>lasttime then
      lasttime=Time:GetCurrent()
      ...do stuff you want to happen every 5sec
    end
    

    • Upvote 2
  2. Disable physics for it, using SetPosition() on physics enabled objects isn't really how you are suppose to do it. You should use forces.

     

    EntityDoor->SetMass(0.0f);

     

    Also note that the door prefab you are using has a connected script : SlidingDoor.lua

     

    You would be better off just loading the model file (mdl) for the door in your example, not the physics enabled prefab which also has a script attached to it.

  3. You can manipulate terrain using Terrain:SetHeight(x,y,z,false) with perlin noise.

     

    However computing perlin noise in lua is rather painly slow, lua doesn't do complex maths very fast compared C/C++ witch upto hundreds times faster or GLSL by thousands times faster. (yes I've tested) So I'd recommend using C/C++ or GLSL for the noise generation, rest could be done in lua just fine.

×
×
  • Create New...