Posts

Showing posts from August, 2022

rigidbody.addforce not working

Image
  Rigidbodies are used to link or attach one object to another allowing the simulated object to deform under normal forces. Most rigidbodies use an addForce method which adds force to an object based on their location. If the force is not applied correctly, an error could be thrown and this may result in unexpected behavior when using it. rigidbody.addforce not working By  Daragard  on  Apr 26, 2021 //Even though Unity says that transform.forward = Vector3(0, 0, 1) that is not the case //This is the line that you want gameObject.GetComponentOfType<Rigidbody>().AddForce(transform.forward * 200,ForceMode.Impulse);; //This line will give you seemingly random values gameObject.GetComponentOfType<Rigidbody>(). AddForce(new Vector3(0, 0, 200, ForceMode.Impulse); Add Comment -1 All the possible answers of the questions are given above. You can also give your valauable suggestions.

"Can't bind to 'formGroup' since it isn't a known property of 'form" Code Answer's

  My code environment is Angular 9, and when I set up reactive form, I met this error: error NG8002: Can't bind to 'formGroup' since it isn't a known property of 'form' . I did s Solution 1: If the  RecipeEditComponent  belongs to AppModule, you need to declare the  RecipeEditComponent  in  app.module.ts : import { RecipeService } from './recipes/recipe.service' ; import { BrowserModule } from '@angular/platform-browser' ; import { NgModule } from '@angular/core' ; import { FormsModule , ReactiveFormsModule } from '@angular/forms' ; import { RoutingModule } from './routing.module' ; import { ShoppingListService } from './shopping-list/shopping-list.service' ; import { AppComponent } from './app.component' ; // Add following line: import { RecipeEditComponent } from './recipes/recipe-edit/recipe-edit.component' ; // add this import { RecipesComponent } from './recipes...