Running behaviours off world clock/time

EwokPDEwokPD Member, PRO Posts: 35
Hello,

I have two nodes that are going to be shooting each other and do not want the shots to collide. So thought it would be nice to run the shooting code off the world clock to avoid the use of contraints etc.... so thought of something along the lines of

if floor(world time) is divisible by 2 with no remainder node 1 fire...

if floor(world time) is not divisible by 2.. ie has something after the decimal point node 2 fire...

I have no idea how to code this though - i know it should be possible just my brain today refuses to give me the anser... can any one help with the code for this please... i am sure it should be a single line... two at most?

Thanks

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    @EwokPD

    Hi, bit confused by this question, personally... why would you want to use the world clock in place od constraints? It wouldn't be possible anyway, as far as I'm aware. Also, with respect, you're making something simple, complicated - (if i haven't misunderstood) – if there are no collision rules within the shot actors, they won't collide anyway...
  • EwokPDEwokPD Member, PRO Posts: 35
    Was trying to avoid constraints due to reading about performance hits with too many off them. So was trying to solve the problem by not using them if possible

    And its purely an aesthetic the reason for not wanting to have the bullet collide. The bullets will not collide in the physics either way... but look wrong overlapping each other on their way to respective targets hence the need to differentiate the order at which they shoot to avoid the overlap.

    In the end got it working by using a constrain - i could equally run it off a timer I guess... and yes i do tend to over complicate matters :P

Sign In or Register to comment.