Notifications
Clear all

[Closed] Help improving a script

Hi all,

So still being fairly new to maxscript I created this script. Its simple, the idea behind it is to be able to change on radio button to change the object it affects. Its more for a character creation script I’m working on to help create assets for the project.

Just wanted to know if there were better ways to do this as well as tips on organising a script etc.

delete $Blue_Ball
delete $Red_Ball
Sphere name:"Blue_Ball" wirecolor:blue radius:20 segs:50 position
Sphere name:"Red_Ball" wirecolor:red radius:20 segs:50
-- $Red_Ball.pos.x = 50
BallObject = $Red_Ball
BallObject.pos.x = 50
fn moveObject objectMover =
(
	objectMover.pos.x = objectMover.pos.x + 10
)

fn checkColor radio_state =
(
	if radio_state == 1 then 
	BallObject =$Blue_Ball
	else 
	BallObject =$Red_Ball
	
)
Try(closeRolloutFloater FirstDialog)catch()

FirstDialog = newRolloutFloater  "Test" 500 500
rollout Create "Creator Tools" 


(

radiobuttons radio_color labels:#("blue", "red")	

on radio_color changed state do checkColor radio_color.state


button btn1 "Move"
on btn1 pressed do
	(
		moveObject BallObject
	)

	
)