#Okey i love simple things π Where i
1 messages Β· Page 1 of 1 (latest)
Depends how you want to set up the logic
If you have a script on the weapon, I recommend just rotating the bullet in the gun script
Can i rotate the object with quaternion.euler ?
If i define the player rotation with new vector3 inside euler
Is it possible ?
GameObject pistolBullet = Instantiate(pistolBulletPrefab, pistolTip.position, Quaternion.Euler(new vector3(player.position.x, 0, player.position.y)));
something like that
that would be awesome
I have a mouselook euler rotation
Can we use it on object with some referrences maybe ?
Well you can convert it with at method, yes
but you cannot directly set the property euler angles
I'm sure that's confusing
hmm okey than I will wait your example
In my course we did smth like this
But i don't have definition for lookingright lookingleft in my code
And i don't want it to do my code much more confusing π
Also that was for 2d my game is 3d
private void SpawnBullet()
{
var bullet = Instantiate(pistolBulletPrefab, pistolTip.position, Quaternion.Euler(new vector3(player.position.x, 0, player.position.y)), out var hit) as GameObject;
var direction = (hit.point.position - bullet.transform.position).normalized;
var lookRotation = Quaternion.LookRotation(direction);
bullet.transform.rotation = lookRotation;
}
This is difficult to type out on discord without my IDE
But something like this. Not 100% sure this is error free though
I also have no clue if the Quaternion math in the raycast works
Even it's will be hard for me to type on my IDE and understand that π
It gets easier with practice
My course just finished last week and I started to do my project for the add my Portfolio
I'm trying π
Ah, well I hope I was able to help. This was a bit difficult to explain π
Code side not hard to understand but animations annoys me like hell
Animations are my enemy
I still don't understand how to run 2 animation at a same time
Blend trees
When i grab my weapon and animation triggers movement animations stop
They said use layers
But i couldn't manage it to do
Thankfully my game is fps π
Blend trees are for blending multiple animations together
Might I recommend something
Yea like movement blend tree seperate for run and normal movement animations
And I am being extremely nice when I say this
Don't make an FPS game when you're first starting out
It'll burn you out
Trust me
Well i kind a start already and almost finish every animations
Just a couple of things
If you ask everything works fine ofcourse not
What is your scope?
But i will try to finish till next friday
My gf pushed me to start unity and I wanna propasal to her after i show my first game
I don't have time to change everything π
No scope for now I can improve the game later
I will be glad if's enemies dies at first π
Feel free to DM me if you need help. Except for animations... EW