Unity3d move object with some force - unity3d

This is what i try to achieve in 2D:
A GameObject
A button
A scene
1) I push the button
2) The GameObject comes in from the side like someone are throwing the GameObject into the scene meaning it have some speed that blends off and stop
I know i need to use RigidBody2d but i do not get it to work. Could someone please give me a hint how to solve this?

You may use free libraries like iTween that allow you to move objects in 3d or 2d space. With iTween making it appear "outside" the screen and move while slowing down to a certain point is easy. Or do you want to use physics for that?

Related

Having one hitbox for Tilemap

I'm trying to make a one way tilemap with platform efector, there is a problem though, because the tilemap collider makes each tile have a collider, the player sticks mid way through the platform if he tries to move because of the colliders, like here OneWayTiles, the player can get through but can't go left or right because he gets stuck, I did figure out that if I take the sprites and make them a prefab they work, I put the box collider and the platform effector on the parent and it works with no problems,
like here, so I do have a solution but it will just take too long drag and drop and change the size if I have to, is there a way I can keep it as a tilemap while not having this problem? thanks in advance.

How can I remove small part of collider of game object in unity 2d

click here for gif show of what I want
I want to remove mesh of object when user click on object and also remove its collider to make another object fall from that removed mesh area...
I am using unity since last month so I don't have much experience and knowledge, please help me...
Creating the destructable ground particles
One way to achieve whats shown in the gif is by creating a prefab of e.g. a circle collider that is instantiated in the area of where the dirt is in your gif. It acts as a "ground particle" and keeps the objects above itself.
You instantiate a lot of them in the area so it acts as a big collider although it is actually a whole array of smaller colliders.
Implementing the interaction logic and deactivating the ground particles
Ater that you implement the functionality of dragging the mouse over the ground particles, removing them. That is also not difficult. Shoot raycasts into the screen at the postition of the mouse (remember to use Camera.ScreenToWorldPoint) and get the collision information (confer to https://docs.unity3d.com/ScriptReference/Collider2D.Raycast.html). With the collision information you can get the reference to the instance of your ground particle(raycasthit.other.gameobject) which is then disabled through script(gameobject.setActive(false)).

Objects not colliding Unity2D

I am trying to make a Retro Tenis Game in Unity2D but I have some issues with the colliding system.
My controller does not collide with the walls. It goes through them.
It should stop in the wall like pic1 but it goes through it like pic2.
Can anyone help me, please?
pic1
pic2
UPDATE#1: I added a RigidBody component but it does not fix it. (pic3)
pic3
You shouldn't use the colliding system for this purpose. It would be much better that the script in charge of moving your paddle was able to control its maximum and minimum height too (note that the screen size can change, and the paddles should move at different heights depending on the screen size).
Although if you want to do it with the collision system and "walls" that limit the space of the paddles, both the "walls" and the paddles need to have a correctly positioned BoxCollider2D and the paddles an extra kinematic Rigidbody2D too (as they can move).
Also make sure to move the paddles using physics and not modifying its position with transform.position (see Rigidbody2D.MovePosition)
Edit: Unity2D physics system is rather a complicated topic and difficult to get it well on your own. I'd suggest to learn the basics in the Unity Learning Platform. You could start with this project.
You need add RigidBody2D to your "circle"

Is there a way to have camera follow g-force in Unity 3D (versioon 2019.3.15f1)?

I am making a game where at one point the player flies a plane/spaceship, and was wondering if there is a way for the camera to move slightly up when the player flies down, and vice versa, same for left and right so that it might make it feel better to play, and slightly more realistic then just a static camera movement.
Thanks a lot !
PS: Beginner here, so sorry if it's an obvious answer...
You can use Unity Standard Assets script CameraFollowsPlayer (Not sure of the name but it is something like this) and you drag and drop your character to your new Camera. It should do the trick with the delay movements. Alternatively you could use Lerp and transform Cameras Position in LateUpdate() method.

how to add frictionless effect to an object on a plane

I'm new to Unity and the is working on a personal project. In the following picture, you can see a blue plane in the middle, I want to use it as a ice plane and there should be no friction when user is walking on it. In another way, if I press 'w', the object should move forward until it hits an object. I know there's a built-in function called physic material, but it works only when the plane is tilt at some angle so that the object will slide down from the top to the bottom, but if the plane is placed in a horizontal level it will not work. Anybody has any suggestions for it, thanks.
Answering from my phone and off the top of my head, but look at using input.getaxisraw() to get your direction data then add forces. use triggers to stop the movement when you reach a trigger on another object. There were some good tutorials on Collisions and triggers on unity tutorials. To elaborate more, you can add colliders to the objects that you want your player object to interact with physically. So for your player object you can add code like:
OnTriggerEnter(collider c) {
// stop movement
}