#Okey i love simple things πŸ˜„ Where i

1 messages Β· Page 1 of 1 (latest)

severe vector
#

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

slender plank
#

Can i rotate the object with quaternion.euler ?

#

If i define the player rotation with new vector3 inside euler

#

Is it possible ?

severe vector
#

Not sure if euler has a setter

#

let me check

slender plank
#

GameObject pistolBullet = Instantiate(pistolBulletPrefab, pistolTip.position, Quaternion.Euler(new vector3(player.position.x, 0, player.position.y)));

#

something like that

severe vector
#

Not quite

#

Let me type out an example really quick

slender plank
#

that would be awesome

#

I have a mouselook euler rotation

#

Can we use it on object with some referrences maybe ?

severe vector
#

Well you can convert it with at method, yes

#

but you cannot directly set the property euler angles

#

I'm sure that's confusing

slender plank
#

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

severe vector
#
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

slender plank
#

Even it's will be hard for me to type on my IDE and understand that πŸ˜„

severe vector
#

It gets easier with practice

slender plank
#

My course just finished last week and I started to do my project for the add my Portfolio

#

I'm trying πŸ˜„

severe vector
#

Ah, well I hope I was able to help. This was a bit difficult to explain 😁

slender plank
#

Code side not hard to understand but animations annoys me like hell

severe vector
#

Animations are my enemy

slender plank
#

I still don't understand how to run 2 animation at a same time

severe vector
#

Blend trees

slender plank
#

When i grab my weapon and animation triggers movement animations stop

#

They said use layers

#

But i couldn't manage it to do

severe vector
#

Oh that's what you mean

#

Don't use blend trees for that

slender plank
#

Thankfully my game is fps πŸ˜„

severe vector
#

Blend trees are for blending multiple animations together

#

Might I recommend something

slender plank
#

Yea like movement blend tree seperate for run and normal movement animations

severe vector
#

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

slender plank
#

Well i kind a start already and almost finish every animations

#

Just a couple of things

#

If you ask everything works fine ofcourse not

severe vector
#

What is your scope?

slender plank
#

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 πŸ˜„

severe vector
#

Ah, never mind then

#

I wish you the best of luck then πŸ˜ƒ

slender plank
#

I will be glad if's enemies dies at first πŸ˜„

severe vector
#

Feel free to DM me if you need help. Except for animations... EW

slender plank
#

Thanks a lot

#

There is a few error

#

should i define that player as transform ?

#

public transform player;

#

or gameobject ?