Question How do you rotate a custom unity asset via button trigger?

VamBlaster

Active member
Messages
81
Reactions
195
Points
33
I'm using this skybox where if it's rotated a certain way looks like it is transitioning from afternoon to dusk outside my scene window.

I want to rotate this skybox (which is a custom unity asset) via button trigger but can't see a way to do it. I looked into all the options for control, atomcontrol, etc.. found only the x/y/z rotation locks but not for the rotation itself.

I figure this would be handy for rotating any custom unity asset for future reference, but I must be looking in the wrong place to try and rotate it.

Is this possible?
 
You need to write a script sadly. Take a look at my asset "The Fridge", that has a script for opening the doors.
It's basically just rotating them so could probably be adapted for your use.

Listen to people smarter than me :)
 
Last edited:
Upvote 0
You can probably animate your skybox using simple animation pattern. :unsure:

-create 3-4 steps AP with or without looping (same XYZpos as your CUA skybox)
-change only steps rotation by ~45° (example: step1-0, step2-45, step3-90...more or less)
-link CUA to AP (animate), manually test/slide AP current time to verify rotation/transition...if good set autoplay/loop forever
or add manual trigger (to specific step/current time/speed/play/pause/...whatever you need)

...hope this helps. ;)

EDIT: No simple/single trigger that changes pos/rotation of atom (one way or another...you have to put some work in).
 
Upvote 0
EDIT: No simple/single trigger that changes pos/rotation of atom (one way or another...you have to put some work in).
LogicBricks has got a "LinearAnimation" brick. Put it on your CUA and position the atom in your original position, then press "Set Position 0". Now get the CUA into the end position and press "Set Position 1". With the "Transition" slider you can now animate between the two positions you set, which of course can also be set via trigger. I recommend to drive the thing with the OnValueTrigger of a Blend brick and have "Blend Smooth" enabled there to you have nice acceleration/decceleration.
 
Upvote 0
I haven't looked at logicbricks yet because I'm still learning the basics. I haven't even touched timeline animations yet, I've been using the built in canned animations for my scenes. Like walk forward, sit, stand up, etc. lol But logic bricks does sound intriguing, I'll have to sit down one day and go through some tutorials.
 
Upvote 0
I haven't looked at logicbricks yet because I'm still learning the basics. I haven't even touched timeline animations yet, I've been using the built in canned animations for my scenes. Like walk forward, sit, stand up, etc. lol But logic bricks does sound intriguing, I'll have to sit down one day and go through some tutorials.

No need for timeline, build-in animations or logicbricks. Though, it would maybe give you more control once you have managed to wrap your head around.
The most simple solution would be like RandomVAMUser said. The good old build-in function of "animation patterns".
You can find it in the same menu where you can add triggers, force atoms, etc. It looks a bit overwhelming at start, most important thing to know is, that you have to click on "create new step before/after...", and that it will remind not only position changes of the steps, but also turning.
IMHO using one of those plugins for simple turning an atom is a bit like cracking a nut with a sledgehammer.

If you can't figure it out at all, there are some scenes out there with turning platforms to display your figure or for look creation. You maybe want to take a look how it is done there.
 
Upvote 0
Back
Top Bottom