x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

problem with collision of spawned actor

hi guys!

premise, I'm developing a game 2d top down. I created a class called room. If the editor drag and drop my class in the level, everything works fine. But if I create the class at run time, it does not collide in right way with the player. I checked all the preset collision and are setup in the same way into both cases.

sry for my bad english

edit: in the class there are some invisible boxcomponents that serve as walls of the room. These work perfectly. The problem is with the player's movements. After the player receives a movements input, it will not stop, as if he could not collide with the floor of the room.

Spawner code:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "HeoressDoodle.h"
 #include "LevelGenerator.h"
 
 
 // Sets default values
 ALevelGenerator::ALevelGenerator()
 {
      // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
 
 }
 
 // Called when the game starts or when spawned
 void ALevelGenerator::BeginPlay()
 {
     Super::BeginPlay();
     SpawnStartRoom();
     
 }
 
 // Called every frame
 void ALevelGenerator::Tick( float DeltaTime )
 {
     Super::Tick( DeltaTime );
 
 }
 
 void ALevelGenerator::SpawnStartRoom()
 {
     UE_LOG(LogTemp, Error, TEXT("SpawnStartRoom--->STARTED "));
     UWorld * World = GetWorld();
     if (World)
     {
             StartRoom = World->SpawnActor<ARoom>(ARoom::StaticClass(), FVector::ZeroVector, FRotator::ZeroRotator);
             if (StartRoom)
             {
                 UE_LOG(LogTemp, Warning, TEXT("StartRoom --->IMPOSTATA "));
                 UE_LOG(LogTemp, Warning, TEXT("nome StartRoom :  %s"), *StartRoom->GetName());
             }
             else
             {
                 UE_LOG(LogTemp, Warning, TEXT("StartRoom --->FALLITA "));
                 
             }
     }
     StartRoom->Attiva = true;
     StartRoom->SetActorEnableCollision(true);
 }





Product Version: UE 4.13
Tags:
more ▼

asked Dec 04 '16 at 06:54 PM in C++ Programming

avatar image

mrc.sofia90
1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question