[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: wp4151275-3967241778.jpg (59 KB, 1024x1024)
59 KB
59 KB JPG
>decide to get into coding
>figure roblox lua will be an easy place to start
>binge a few tutorials
>okay time to make some original code
>try to write a script that will print a dice-roll result from a 3d dice model falling naturally in the game
>face of the dice hits the baseplate
>game detects what face hit the baseplate
>but it's still rolling so that result is not useful
>wait until it's stopped rolling
>but then the face that hits the baseplate is the underside of the dice
>instead print the opposite face, ie the one facing up
>can't figure it out
Is it over before it even began? I've been at this for 3 hours
>>
opposite sides of a dice always add up to 7
so print (7 - face that hit the baseplate)
>>
I think I need to spend more time learning the syntax. I've learned some of the concepts but can't figure out how to put them into a script that the computer likes
>>
>>100146547
interesting, didn't know that
>>
Wait until it stops rolling, then check which of the cube's orientation vector (up, right, forward) is (loosely, cause floats) parallel to the world vertical one (0,1,0). Adjust for opposite face with the result vector's y component sign
>>
>>100146547
That's a nice work around
>>
>>100147169
This also op should show his code
>>
>>100146547
Double check if it's the case for your model.
>>
>>100146502
just print a random number, zoomers aren't going to look that the dice anyway
>>
>>100146502
you coded all that as a novice?
cube physics?
>>
>>100146502
Lol you watched that one child Roblox dev youtuber's tutorial with the dice

I watched it a couple of years ago too
>>
>>100150173
Roblox provides a physics engine
>>
>>100146502
Try making a gun first
>>
>>100151329
-which is very based.
>>
>>100150173
Have you never seen a roblox video? Roblox provides camera, physics, texture, everything; even the character
>>
>>100146502
If you started from zero that's actually pretty good for only 3 hours.
>>
>>100146502
lua is a historically dogshit proprietary programming language

go learn python, you’ll have a much more enjoyable time there



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.