Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Dark Physics Dynamic Force Fields

Author
Message
dance dreemer
21
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 7th Apr 2011 13:38 Edited at: 7th Apr 2011 13:40
Hi all,

i was just wondering if there is a way of dynamically turning on / off a rigid body force field based on a condition, e.g: a mouse click.

I have tried to turn the force field on/off by using:

if mouseclick()=1
phy add force field sphere 1, 0, 0.0, 0.0, 0.0, 10
else
phy add force field sphere 1, 0, 0.0, 0.0, 0.0, 0
endif

however changing the last parameter (force field radius) dose not work as it seems it cant be updated at runtime.

any help would be greatly appreciated.

thanks in advance.

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Apr 2011 15:46
been some time since I've used it but here's how i think I remember doing it.

h# is calulated like so
h#=rnd(10)/100.0+2
which makes a random size force sphere.





and here attract and repeal



Dark Physics makes any hot drink go cold.
dance dreemer
21
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 7th Apr 2011 16:09
Hi Howdo,

thanks, this code helped me allot

much appreciated..

Login to post a reply

Server time is: 2024-11-24 13:46:51
Your offset time is: 2024-11-24 13:46:51