Jump to content

help in changing a colshape's size


Me[Z]oO

Recommended Posts

Posted
local radius = 520
local MySphere = createColSphere(0, 0, 3, radius)
function changeSize( size )
	radius = size
	if ( radius > 10 ) then 
		setTimer ( changeSize, 1000, 0, radius-1 )
	end
end
setTimer ( changeSize, 1000, 0, radius-1 )

not work !

Posted (edited)

Because the element is already created. You'll have destroy and then create it in your function called by the timer.

Edited by NeXuS™
Posted
Just now, NeXuS™ said:

Because the element is already created. You'll have destroy and then create it in your function called by the timer.

by this way it maybe bring lag 

can u edit my code to your way because I didn't understand you

Posted (edited)
local radius = 520
local MySphere = createColSphere(0, 0, 3, radius)
function changeSize()
	radius = radius - 10
	destroyElement(MySphere)
	MySphere = createColSphere(0, 0, 3, radius)
end
setTimer(changeSize, 1000, 0)

 

Edited by NeXuS™
  • Thanks 1
  • Moderators
Posted

If you do this every second, yes. (little network lagg, which will be visible by players with slow internet)

But every 2 minutes will be fine.

 

Posted
19 hours ago, IIYAMA said:

If you do this every second, yes. (little network lagg, which will be visible by players with slow internet)

But every 2 minutes will be fine.

 

And what about 10 seconds
Does a lag come? :(

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...