problem mit collision

  • problem mit collision

    Das stört mich schon lange aber lest erst mal. Ich habe folgendes Problem:

    Ich habe ein Objekt das schnell auf ein Anderes zukommt(so mit Geschwindigkeit 3-20). Dieses soll aber genau vor dem Objekt stehen bleiben und nicht erst dann wenn es schon halb im Objekt drinn ist.Das hab ich schon probiert:

    Bei collision mit dem Objekt wird die Geschwingigkeit 0 gesetzt

    Das bei jedem step abgefragt wird ob ein Objekt vor dem anderen ist. Und dann die Geschw. 0 gesetzt wird.

    Bei beidem rammt das Objekt in das Andere außer ich stelle bei dem zweitgenannt ein das das Objekt 5 Felder neben dem sein muss(dann gibt es aber Andere probleme die ich nicht verstehe: Um so weiter das objekt "anlauf" hatte umso weiter rammt es ins objekt)
  • Probiers mal damit:
    move_contact_solid(dir,maxdist) Moves the instance in the direction until a contact position with a solid object is reached. If there is no collision at the current position, the instance is placed just before a collision occurs. If there already is a collision the instance is not moved. You can specify the maximal distance to move (use a negative number for an arbitrary distance).
  • Benutzer online 1

    1 Besucher