#Troubles with rotation
1 messages · Page 1 of 1 (latest)
so you mean that when you are trying to rotate its e.g. x axes - rotates smth another e.g. y or z ?
startDirection = Quaternion.Euler(
ability.AngleOffset.x,
ability.AngleOffset.y,
ability.AngleOffset.z)
* Vector3.forward;
rotation = Quaternion.LookRotation(startDirection);```
Ok, so the idea is I have a character that shoots a projectile forward from their position
yeah, I have seen it already
I hope you know that you have a little bit redundant code
you cannot change x directly, right?
answer this question, please
no, I'm trying to rotate the x and z so the ability shoots out on an incline
changing the y will rotate it around the position
x/z will give some verticallity of the ability
what do you mean by "around the position" ?
y rotates it up and down, yes
x and z rotate it forward, backward, right and left
Also you have said that changing x position affetcs your y position
that cannot be
is it your issue?
changing the y does not get the direction any verticality
so that's the issue?
it rotates it around the y axis, with a vector3.up
using quaternion.lookrotation method
I don't get what's going wrong.
You cannot change its axes?
or do they change not like you want them to?
I have it changing, but depending on the forward direction of my transform, changing the x/z is not consistant
I can look one way, and it will cast downward, then changing my forward direction of my transform can make it cast upward with the same angle offset
some method of operations I'm missing here
what is ability ?
it's just a gameobject
ability must look player's rotation ?
no
I mean
player must look ability's rotation, right ?
but that doesn't make sense
startDirection = Quaternion.Euler(
ability.AngleOffset.x,
ability.AngleOffset.y,
ability.AngleOffset.z)
* transform.forward;```
er
yes, you have sent it already
ability is just data for the offset, the transform is the ability itself
that's so strange actually.
can you make a video or screenshot of your issue?
hold on
maybe you should apply rotation based on initial rotation?
// use initial transform.rotation
startDirection = transform.rotation * Quaternion.Euler(ability.AngleOffset) * Vector3.forward;
rotation = Quaternion.LookRotation(startDirection);
hmm
also I hope that you know that this is redundant
startDirection = Quaternion.Euler(
ability.AngleOffset.x,
ability.AngleOffset.y,
ability.AngleOffset.z)
* transform.forward;
just
startDireciton = Quaternion.Euler(ability.AngleOffset) * transform.forward;
I been fooling around a bit with it so I've had different variations
I see
why need to rotate the projectiles tho?
try to use initial rotation too
they look rotation of data projectiles as I have understood
ive a lot going on with the projecitles
yeah, that doesn't make sense for me.
why not just moveTwords
or how was the command called
if you can change it's forward
their change rotation
why need for rotation
they need rotation, not position
oh so they want to literally rotate the projectile
yes, why do they use LookRotation then ?
rotate somewhere, then to go there
what?
to ?
wherever u want ig
I don't get you
actually I also don't get what Mao is trying to do
and they also don't explain it properly
well, wouldn't a from start explanation
help
@austere urchin you can even draw if it's easier!
it helped me a lot in the past
they're just not very talkative 🤔
hey, im still trying here lol
ik, sorry for me and friend's little chat there
I sent some screenshots and thought it was pretty self explanatory
but I think the idea is the starting rotation of the object and the issue is I dont actually give it the rotation values until next frame (some init function)
so you want the rotation to corespond with where the charcahter is aiming in the Y axis?
they have explained me nothing
they explain a lot
not for me.
@austere urchin if it what i am thinking set the position/forward of the spawn in the forward of the character you are willing to aim, like
you do not really have to work a lot with rotation on projectiles tbh
that's what i did and works perfectly
I think you not thing about what I am thinking they are thinking
I also don't know what is ability and what is gameObject in their script
Yeah, I've had it working with the forward direction fine, but introducing angle offset which adds some vertical movement creates some problems. I think I may understand what's going on and it's probably because I need to send data on the next frame.
It's very relative to this idea though
I don't understand anything actually
I think you should learn how to explain your issues.
yeah, it's not easy to be that discrete without posting a huge chunk of code that this little tadbit represents
but the problem does revolve around the forward position of a transform and quaternion values not respecting it
if you had explained your issue a bit better, it should have been a easier for me to help you.
and it looks like it comes down to the original transform value rotation does not update as I want it on instantiation. It's some constraint class I'm using and it takes a frame to update the values
hahaha, I don't understand anything you say
was is a question, or..?
no, I said I probably understand now, just waiting for compilement zzz
yeah, ok, I also don't think that I can help you more without understanding your issue.
yeah np ty though
yeah that was the problem. I needed the transform rotation as the FIRST value to multiply as well
looks cool
and needed to get it the next frame because how I'm pooling it all
yeah, isn't that what I have suggested you?
yep ;)
ok, I still don't know what you are doing, but I am glad you have fixed your issue
yeah, organised with Headers though
eventually