Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
(to my very poor defense, it was after 2 days and nights of gamejam-style marathon coding)
-
Kimmax109407yHuh? If you have xy coordinates from look at, apply y to the parents y, add -y to the child's y (if it should stay how it was), apply x to child.
???
Profit
How you apply the negative y to the child depends on how it's positioned relatively to the parent
lookAt = { 5, 10 }
parent.Y = lookAt.Y
child.Y = -lookAt.Y
child.X = lookAt.X
Don't know if it makes sense at all, I made this up in my mind. Maybe it helps 🙆🏻♀️ -
@Kimmax it makes theoretical sense (except LookAt is a function on the transform, taking the target point as param, so you have to do the splitting (zeroing of vector components) on the position before supplying it to the func), and i tried that, but there's still some fiddly details in implementation, and i couldn't get it to behave correctly.
yes, as i said, should be trivial in theory, was not (at least for me at that time) in implementation. why do you think i posted it as wk88 topic? ;) -
@Kimmax negative y shouldn't be applied to the child because i apply relative/local rotation therefor child partially rotates with parent and that's fine... or i do have to apply it, not sure, none of the variants worked but maybe i had error somewhere upstream and dude, what is this? stackoverflow? i was ranting, not asking for advice!!! =D
thanks for the effort, though
Related Rants
-
Badr9When I Googled a problem I faced, and found a YouTube video solving it, then tried to thumb 👍 it up, but Yo...
-
ogzet16That weak moment when I googled “how to invert a boolean”
-
baskoros244+ years of programming. Still have no clue how to make my own regex pattern. Every single time I need to, I...
spending 2 hours to split LookAt rotation between two nested transforms where parent was supposed to only recieve the vertical axis rotation and the child the horizontal axis rotation. (unity3d)
still haven't solved it btw, because my nerves and the deadline of the project i needed it for both ran out and i'm still sick to my stomach at the thought of going back to it to solve it because of how trivial it should be and how insanely was i battling with it.
rant
wk88