unity character attached to game object - unity3d

I'm quite new to Unity and there is one thing i couldn't think of how to make it and i couldn't exact information either so here i am. (sorry, my English is not perfect)
what i want to do is attaching a character to game object.
In my game, player(user) will control or steer the game object and the character attached to the game object just Looks as if it's riding or driving the game object.
(to help you understand, maybe you can imagine that player control a skateboard and there is a character on it)
So far, I tried 2 ways -
1. I made character as child of the game object, and gave an animation to the character but i found out it is not looks very natural.
2. I made a ragdoll and tried to attach it to the game object by using fixed joint between the game object and the character's feet but in playing mode, only ragdoll's feet was moving with the game object.
So I wonder if there is a good way to do it.
Anybody can give me an advice? I would so appreciate it.
Thanks in advance.

Your solutions is here, and its called IK:
1https://docs.unity3d.com/Manual/InverseKinematics.html
Invere kinematics isn't an easy topic and you will have to test it a lot(of course you could find some workarounds) but if you want the most elegant solution give it a try.

Related

how do i make a 3d character move in unity with WASD?

I am new to Unity, and I want to make a 3d character movement. Please help me. I have tried tutorials, but they don't work.
You first have to choose what kind of movement you want to accomplish i.e: 1st person, 3rd person etc. And saying that YouTube tutorials don't work definitely means you are missing something. Here are some good tutorials for different 3d movement. Please follow them thoroughly.
1st Person:
https://www.youtube.com/watch?v=_QajrabyTJc
https://www.youtube.com/watch?v=XAC8U9-dTZU
3rd Person:
https://www.youtube.com/watch?v=4HpC--2iowE
You can find a ton more movement systems on Google.
Your movement depends on your usage. You have to use a different approach if you want it to be Character Controller based than Rigidbody based. So learn the basics, and then experiment on your own until you are happy with it.
There are tons of ways to make a player move in 3D, and there are just as many tutorials that explain it. If you need a place to start, see the character controller component.
If you have a 3d model of the character, just add this component and it will start moving right away.
the gameobject does not have to have rigidbody or collider components, because it takes care of the whole character controller.
If I gave you a hand to get started, you can mark my answer as accepted, and vote it positively :)

Lights and shadows in Unity

So, I'm making a game with Unity, and I have to cover other parts of the level with a shadow, so that the player can't see them. This is how the game looks like now, and more or less i'd like it to look like this
Someone nows how to help me? Like with some tutorials or tips.
Thank you so much.
One solution it would be to cover the part of the level with an object, and you may remove it by using a collider to detect if player is near or maybe by player position

Facing AI Seek Behavior issue in Unity

I am currently self-learning steering behaviors and am following this lecture I had found which gives a really good introduction about AI implementation aka https://edirlei.com/aulas/game-ai-2020/GAME_AI_Lecture_07_Steering_Behaviours_2020.html.
I've faced an issue when trying to implement the 'Seek' behavior in a 2D game environment in which the 'seek' game object does not try to move towards its target. There are no errors showing in the console but my best guess is that it's because of the use of Rigidbody in the 'SteeringBehaviorBase' class code. I've tried converting it to Rigidbody2D instead but sadly it still does not move.
For further context, I've attached the 'SteeringBehaviorBase' and 'SeekBehavior' classes onto my 'seek' game object and a circle collider on my 'seek target' game object. I've also set the reference of the seek target property in the 'SeekBehavior' code to the 'seek target' game object.
I would really appreciate anyone's help in guiding me to solve this problem.

Change character model for Third Person Shooter game

I'm having a little problem.
When you start Unreal engine, you can select the type of your game.
I selected Third Person Shooter game basic stuff..(or something similar). But that's not the problem..
The problem is changing the character model..
I want to have my own character model(no need for animations for now) instead of the base one..
Well, I can put my character into the scene but I can't "stick" my character model with the main camera..
Just something like that..
(I know that this post is not about coding)
Could somebody help me with this please? There must be a way to do that.
First, you have to create a new pawn that has the character model you want attached to it. Then, you have to change the default pawn class in your world settings so it will spawn when the game starts.

Unity: Third Person Collision with Animated Platforms

first time posting on stack and everything looks promising so far! I had a bit of a complicated question here so I'll do my best to provide exact details of what I'd like to get accomplished. I'm working with a third person controller in unity, so far everything is going great. I've dabbled with basic up and down platforms, a little glitchy but things work. Anytime my player runs through a mesh I make sure the mesh collider is working and a 'rigid-body' is attached set to Kinematic. Here's the kicker, in my game I have turning gears which the player can jump on. This is great except for the player doesn't turn with my gear, which would make sense according to my game-play. What would be the process for getting my character to interact with this animated mesh? I imagine some sort of script which my nooby mind cannot fathom at this point in my unity career. If anyone out there knows the solution to this, I would love to have any assistance, either way I'll plugging away at a solution. Thanks again!!
This is assuming that you're using the packages that ship with Unity3D, which it sounds like you are. After importing the Character Controllers package, you'll have a bunch of scripts in the Standard Assets\Character Controllers\Sources\Scripts folder, in the project hierarchy view. There's a script in there called CharacterMotor.js, attach that to the same GameObject you're running ThirdPersonController on.
Essentially this script adds more interactivity between the character and the scene. There's several methods inside this script that automatically move the character when in contact with a moving object (as long as it has a collision mesh) basically by inheriting the object's velocity.
If your gear/cog wheel has a proper collision mesh set up, adding this script to your character should be all that you require.