Page 1 of 1

EntityByName

PostPosted: Tue Dec 03, 2019 5:09 am
by eeieeio
Hi everyone. I've been searching the forum for an easy to follow instructions on how to assign a name to an object. The closest I have found is from Kilinich. I thought I was good at following directions, but just can't get it. The problem is adding a name to an object so I can refer to it in an 'on collision' event. When I type "_name = "rectangleshape1"" it does not appear in the script menu. Would really appreciate detailed step by step instructions on how to name an object.

Thanks, Dave

Re: EntityByName

PostPosted: Wed Dec 11, 2019 7:28 pm
by FRA32
Adding a custom variable to an object works like this:

Take your object, right click it
go to script menu,
go to the tiny empty black box in the top left corner
type _literallyAnything = someKindOfValue;
hit enter.

If done correctly, you will now see your new variable at the beginning of the variable list. Here some examples:

_id = 59;

_name = "Something propably";

_origin = pos;

_onJump = (e)=>{vel = vel + [0,5];_jump = false;};