Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Script] Auto facing/rotation

1380367103

Edited 1392422808
Palm
Plus
Obsolete: go here =&gt; <a href="https://app.roll20.net/forum/post/652987/script-automatic-facing/#post-652987" rel="nofollow">https://app.roll20.net/forum/post/652987/script-automatic-facing/#post-652987</a> This script will automatically change the direction tokens are facing when moved around. So they will always have their back from whence they came and their eyes locked forward in the direction you moved them. You can rotate them independently afterwards of course, it only triggers on moving the character. Only affects objects on the object layer. Also, objects named "NR" (no rotation) will not be affected by this script. <a href="https://gist.github.com/anonymous/6741062" rel="nofollow">https://gist.github.com/anonymous/6741062</a>
This isn't working right... if I move up, they face down. If I move down, they face up. Same with left/right.
1380378161

Edited 1380378241
Palm
Plus
Hrmm.. I would suspect this is due to the token. Its designed for tokens that face the direction you drag the little piston towards. That is tokens that look upwards in the library. Flipping them vertically should do the trick.
All of devin nights tokens are made facing down by default.
Id change line 33 to obj.set("rotation", degs+180); to adjust for that then.
1380390263

Edited 1380390803
Cool. That worked!