EntityByName
2 posts • Page 1 of 1
EntityByName
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
Thanks, Dave
- eeieeio
- Posts: 25
- Joined: Thu Nov 30, 2017 7:02 pm
Re: EntityByName
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;};
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;};
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests