Game Dev
Game Dev
Rb.useGravity=false;
In update, it will happen for the rest of the game -> rate of updation depends on frame rate (faster
computer will run faster than a slower computer)
Video-4
But the above method wont be good in case the object collides with another object
Create->physic(s) material-> set static and dynamic friction to zero and drag it to ground
Use of variables:
Int (whole no), float, string, bool (500f for floats is advised)
To edit variable in inspector: public <type> <data> (inspector is on left side of unity window)
put appropriate addforce commands to have exhibit necessary changes whenever use performs
certain actions
Video-6: Collisions
void OnCollisionEnter(Collision collisionInfo)-> called whenever the object (here,player) collides with
some object
that object can be dragged into Player Collision script as long as it is rigid body and has box collider
Debug.Log(collisionInfo.collider.name);
One utility:
if(collisionInfo.collider.name == "Obstacle")
if(collisionInfo.collider.tag == "Obstacle")
if(collisionInfo.collider.tag == "Obstacle")
Create prefab of obstacle: drag obstacle object to the project panel (to use multiple objects of same
type)
Increase drag
window > Rendering > Lighting > Environment for fog(so that next obstacles are not visible)
For those who don't have their starting position at Z 0, I made something to make it easier:
3. Inside it, add "initialZ = player.position.z" (replace "player" with what you named your player)
4. On the top of the Update() method, add the following: "float newZ = plr.position.z - initialZ;"
or anyone following this tutorial in 2021 or until they change it, you can add text from
GameObject(at the top) -> UI -> Text
If you are using Text Mesh Pro, then disable "Wrapping" instead of enabling "Overflow"
If you have new version unity then lighting is set after GAME OVER is by these steps 1) click on
Window 2) click on Rendering 3) click on Lighting 4) Then click on Generate Lighting which is present
in Light Probe Visualization 5) Done. I hope this helps
Ensure that your sampling rate is at least 10 times the carrier frequency. Since your carrier is 200 kHz,
a sampling rate of 2 MHz or higher is recommended. This will help in accurately capturing the high-
frequency variations of the FM signal for a smooth derivative.